aboutsummaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2010-09-20 02:29:01 -0600
committerJunio C Hamano <gitster@pobox.com>2010-09-29 17:37:04 -0700
commit161cf7f9490285700432f23a953f8e238f3469f5 (patch)
treeea5a89c09bc2e0e04064ea909bdc74c083b52d4f /merge-recursive.c
parent07413c5a3115df424bee1ebe627676df0734f787 (diff)
downloadgit-161cf7f9490285700432f23a953f8e238f3469f5.tar.gz
git-161cf7f9490285700432f23a953f8e238f3469f5.tar.xz
merge-recursive: Move handling of double rename of one file to other file
Move the handling of rename/rename conflicts where one file is renamed on both sides to the same file, from process_renames() to process_entry(). Here we avoid the three way merge logic by just using update_stages_and_entry() to move the higher stage entries in the index from the rename source to the rename destination, and then allow process_entry() to do its magic. 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.c32
1 files changed, 6 insertions, 26 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index d0c68ce2b..05d06f720 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -971,33 +971,13 @@ static int process_renames(struct merge_options *o,
remove_file(o, 0, ren1_dst, 0);
/* ren2_dst not in head, so no need to delete */
} else {
- struct merge_file_info mfi;
remove_file(o, 1, ren1_src, 1);
- mfi = merge_file(o,
- ren1->pair->one,
- ren1->pair->two,
- ren2->pair->two,
- branch1,
- branch2);
- if (mfi.merge || !mfi.clean)
- output(o, 1, "Renaming %s->%s", src, ren1_dst);
-
- if (mfi.merge)
- output(o, 2, "Auto-merging %s", ren1_dst);
-
- if (!mfi.clean) {
- output(o, 1, "CONFLICT (content): merge conflict in %s",
- ren1_dst);
- clean_merge = 0;
-
- if (!o->call_depth)
- update_stages(ren1_dst,
- ren1->pair->one,
- ren1->pair->two,
- ren2->pair->two,
- 1 /* clear */);
- }
- update_file(o, mfi.clean, mfi.sha, mfi.mode, ren1_dst);
+ update_stages_and_entry(ren1_dst,
+ ren1->dst_entry,
+ ren1->pair->one,
+ ren1->pair->two,
+ ren2->pair->two,
+ 1 /* clear */);
}
} else {
/* Renamed in 1, maybe changed in 2 */