@matheusbsbs / matheus-bagliano / commits / ae745487ad
Fork 0

merge-recursive: Fix multiple file rename across D/F conflict

In 5a2580d (merge_recursive: Fix renames across paths below D/F conflicts 2010-07-09), detection was added for renames across paths involved in a directory<->file conflict. However, the change accidentally involved reusing an outer loop index ('i') in an inner loop, changing its values and causing a slightly different type of breakage for cases where there are multiple renames across the D/F conflict. Fix by creating a new temporary variable 'i'. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Aug 17, 2010 at 17:53 UTC ae745487ad7a4ceca0e903da6df21be2c1ebfc29
2 files changed +2 -1
merge-recursive.c
+1
@@ -1020,6 +1020,7 @@ static int process_renames(struct merge_options *o,
1020 if (mfi.clean &&
1021 sha_eq(mfi.sha, ren1->pair->two->sha1) &&
1022 mfi.mode == ren1->pair->two->mode) {
1023 + int i;
1024 /*
1025 * This message is part of
1026 * t6022 test. If you change
t/t6031-merge-recursive.sh
+1 -1
@@ -57,7 +57,7 @@ test_expect_success FILEMODE 'verify executable bit on file' '
57 test -x file2
58 '
59
60 -test_expect_failure 'merging with triple rename across D/F conflict' '
60 +test_expect_success 'merging with triple rename across D/F conflict' '
61 git reset --hard HEAD &&
62 git checkout -b main &&
63 git rm -rf . &&