summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2010-09-20 02:28:59 -0600
committerJunio C Hamano <gitster@pobox.com>2010-09-29 17:37:04 -0700
commit2a669c341a857f53d946dec762e6f22a54b12dd2 (patch)
tree6e4c68b1e60102e543936f06e67479e5f1cce019 /merge-recursive.c
parent61b8bcae2d8f71c566150b0a12e35a9fdc76b82b (diff)
downloadgit-2a669c341a857f53d946dec762e6f22a54b12dd2.tar.gz
merge-recursive: Avoid doubly merging rename/add conflict contents
When a commit moves A to B while another commit created B (or moved C to B), and these two different commits serve as different merge-bases for a later merge, c94736a (merge-recursive: don't segfault while handling rename clashes 2009-07-30) added some special code to avoid segfaults. Since that commit, the two versions of B are merged in place (which could be potentially conflicting) and the intermediate result is used as the virtual ancestor. However, right before this special merge, try_merge was turned on, meaning that process_renames() would try an alternative merge that ignores the 'add' part of the conflict, and, if the merge is clean, store that as the new virtual ancestor. This could cause incorrect merging of criss-cross merges; it would typically result in just recording a slightly confusing merge base, but in some cases it could cause silent acceptance of one side of a merge as the final resolution when a conflict should have been flagged. When we do a special merge for such a rename/add conflict between merge-bases, turn try_merge off to avoid an inappropriate second merge. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index b9bc95a659..6ffc67ade4 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1061,6 +1061,7 @@ static int process_renames(struct merge_options *o,
mfi.sha,
mfi.mode,
ren1_dst);
+ try_merge = 0;
} else {
new_path = unique_path(o, ren1_dst, branch2);
output(o, 1, "Adding as %s instead", new_path);