Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-04-22 14:58:04 +0400
committerJunio C Hamano <junkio@cox.net>2006-04-22 15:03:32 +0400
commit5c21ac0e7c475c82039ab604ee9d7d8430889346 (patch)
tree4dc25e01b3d8b9bf4eb46bab7c9632afd84c29fa /diff-lib.c
parente09ad6e1e3308fde346b4b6287d9441363806832 (diff)
Libified diff-index: backward compatibility fix.
"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>
Diffstat (limited to 'diff-lib.c')
-rw-r--r--diff-lib.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/diff-lib.c b/diff-lib.c
index 63da3b521d..2183b41b03 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -308,12 +308,20 @@ static void mark_merge_entries(void)
}
}
-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");