aboutsummaryrefslogtreecommitdiffstats
path: root/read-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-06-11 02:53:57 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-12 20:40:20 -0700
commit036d51cc557bcf919246ad30cb2ac7736bfc836b (patch)
tree0691823355c5aa9b395fab377e11582808d38687 /read-tree.c
parent32192e6622d78347448cfc0572827d6e64e0de28 (diff)
downloadgit-036d51cc557bcf919246ad30cb2ac7736bfc836b.tar.gz
[PATCH] read-tree: loosen too strict index requirements
This patch teaches read-tree 3-way merge that, when only "the other tree" changed a path, and if the index file already has the same change, we are not in a situation that would clobber the index and the work tree, and lets the merge succeed; this is case #14ALT in t1000 test. It does not change the result of the merge, but prevents it from failing when it does not have to. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'read-tree.c')
-rw-r--r--read-tree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/read-tree.c b/read-tree.c
index d86cc0263c..0d94fe214d 100644
--- a/read-tree.c
+++ b/read-tree.c
@@ -280,6 +280,12 @@ static int threeway_merge(struct cache_entry *stages[4],
}
/* otherwise we will apply the original rule */
}
+ /* #14ALT */
+ if (a && b && c && same(a, b) && !same(a, c)) {
+ if (old && same(old, c))
+ return merged_entry_allow_dirty(c, old, dst);
+ /* otherwise the regular rule applies */
+ }
/*
* If we have an entry in the index cache ("old"), then we want
* to make sure that it matches any entries in stage 2 ("first