summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e09ad6e)
raw | patch | inline | side by side (parent: e09ad6e)
author | Junio C Hamano <junkio@cox.net> | |
Sat, 22 Apr 2006 10:58:04 +0000 (03:58 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 22 Apr 2006 11:03:32 +0000 (04:03 -0700) |
"diff-index -m" does not mean "do not ignore merges", but means
"pretend missing files match the index".
The previous round tried to address this, but failed because
setup_revisions() ate "-m" flag before the caller had a chance
to intervene.
Signed-off-by: Junio C Hamano <junkio@cox.net>
"pretend missing files match the index".
The previous round tried to address this, but failed because
setup_revisions() ate "-m" flag before the caller had a chance
to intervene.
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff-index.c | patch | blob | history | |
diff-lib.c | patch | blob | history | |
diff.h | patch | blob | history |
diff --git a/diff-index.c b/diff-index.c
index 4a243b36248362c4627a34957703fba33cb885eb..86940123b37d9b7853643e32392cb80cda6e6b86 100644 (file)
--- a/diff-index.c
+++ b/diff-index.c
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
- if (!strcmp(arg, "-m"))
- match_missing = 1;
- else if (!strcmp(arg, "--cached"))
+ if (!strcmp(arg, "--cached"))
cached = 1;
else
usage(diff_cache_usage);
if (!rev.pending_objects || rev.pending_objects->next ||
rev.max_count != -1 || rev.min_age != -1 || rev.max_age != -1)
usage(diff_cache_usage);
- return run_diff_index(&rev, cached, match_missing);
+ return run_diff_index(&rev, cached);
}
diff --git a/diff-lib.c b/diff-lib.c
index 63da3b521d3bf580709ef6bf0f6e4aa83ff7d958..2183b41b03d08092ba6d98a642757640b86710d6 100644 (file)
--- a/diff-lib.c
+++ b/diff-lib.c
}
}
-int run_diff_index(struct rev_info *revs, int cached, int match_missing)
+int run_diff_index(struct rev_info *revs, int cached)
{
int ret;
struct object *ent;
struct tree *tree;
const char *tree_name;
+ int match_missing = 0;
+
+ /*
+ * Backward compatibility wart - "diff-index -m" does
+ * not mean "do not ignore merges", but totally different.
+ */
+ if (!revs->ignore_merges)
+ match_missing = 1;
if (read_cache() < 0) {
perror("read_cache");
index 837d449f81246ab57b6604e068a49b85d33df64c..7150b90385952373f4fd49eb073d819541cc306d 100644 (file)
--- a/diff.h
+++ b/diff.h
extern int run_diff_files(struct rev_info *revs, int silent_on_removed);
-extern int run_diff_index(struct rev_info *revs, int cached, int match_missing);
+extern int run_diff_index(struct rev_info *revs, int cached);
#endif /* DIFF_H */