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>

Elijah Newren committed Aug 11, 2011 at 23:20 UTC 7769a75e96f998b2f1ef51e8a2e88058f56fa519
1 file changed +11
merge-recursive.c
+11
@@ -1085,6 +1085,9 @@ static int process_renames(struct merge_options *o,
1085 }
1086
1087 ren1->dst_entry->processed = 1;
1088 + /* BUG: We should only mark src_entry as processed if we
1089 + * are not dealing with a rename + add-source case.
1090 + */
1091 ren1->src_entry->processed = 1;
1092
1093 if (ren1->processed)
@@ -1111,6 +1114,10 @@ static int process_renames(struct merge_options *o,
1114 ren1->dst_entry,
1115 ren2->dst_entry);
1116 } else {
1117 + /* BUG: We should only remove ren1_src in
1118 + * the base stage (think of rename +
1119 + * add-source cases).
1120 + */
1121 remove_file(o, 1, ren1_src, 1);
1122 update_entry(ren1->dst_entry,
1123 ren1->pair->one,
@@ -1134,6 +1141,10 @@ static int process_renames(struct merge_options *o,
1141 int renamed_stage = a_renames == renames1 ? 2 : 3;
1142 int other_stage = a_renames == renames1 ? 3 : 2;
1143
1144 + /* BUG: We should only remove ren1_src in the base
1145 + * stage and in other_stage (think of rename +
1146 + * add-source case).
1147 + */
1148 remove_file(o, 1, ren1_src,
1149 renamed_stage == 2 || !was_tracked(ren1_src));
1150