summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2011-08-11 23:20:05 -0600
committerJunio C Hamano <gitster@pobox.com>2011-08-14 14:19:37 -0700
commit7769a75e96f998b2f1ef51e8a2e88058f56fa519 (patch)
tree19146cd6e2423c0ceca3da760aabb1707eb8bb1e
parent0a6b87126e6a4e2649f6da23db67eeaad11d102e (diff)
downloadgit-7769a75e96f998b2f1ef51e8a2e88058f56fa519.tar.gz
merge-recursive: Add comments about handling rename/add-source cases
There are a couple of places where changes are needed to for situations involving rename/add-source issues. Add comments about the needed changes (and existing bugs) until git has been enabled to detect such cases. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--merge-recursive.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 47b32f79d4..7f169ade1e 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1085,6 +1085,9 @@ static int process_renames(struct merge_options *o,
}
ren1->dst_entry->processed = 1;
+ /* BUG: We should only mark src_entry as processed if we
+ * are not dealing with a rename + add-source case.
+ */
ren1->src_entry->processed = 1;
if (ren1->processed)
@@ -1111,6 +1114,10 @@ static int process_renames(struct merge_options *o,
ren1->dst_entry,
ren2->dst_entry);
} else {
+ /* BUG: We should only remove ren1_src in
+ * the base stage (think of rename +
+ * add-source cases).
+ */
remove_file(o, 1, ren1_src, 1);
update_entry(ren1->dst_entry,
ren1->pair->one,
@@ -1134,6 +1141,10 @@ static int process_renames(struct merge_options *o,
int renamed_stage = a_renames == renames1 ? 2 : 3;
int other_stage = a_renames == renames1 ? 3 : 2;
+ /* BUG: We should only remove ren1_src in the base
+ * stage and in other_stage (think of rename +
+ * add-source case).
+ */
remove_file(o, 1, ren1_src,
renamed_stage == 2 || !was_tracked(ren1_src));