Code

merge-recursive: Fix multiple file rename across D/F conflict
authorElijah Newren <newren@gmail.com>
Tue, 17 Aug 2010 23:53:19 +0000 (17:53 -0600)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 Aug 2010 19:08:08 +0000 (12:08 -0700)
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>
merge-recursive.c
t/t6031-merge-recursive.sh

index 52936c35aec413ad8adf10cdd0a80f9bd282abd2..250e140355c83cf65207496fdc3ca908df614deb 100644 (file)
@@ -1020,6 +1020,7 @@ static int process_renames(struct merge_options *o,
                                if (mfi.clean &&
                                    sha_eq(mfi.sha, ren1->pair->two->sha1) &&
                                    mfi.mode == ren1->pair->two->mode) {
+                                       int i;
                                        /*
                                         * This message is part of
                                         * t6022 test. If you change
index c50ee295a7bc0e8df74aa5913999b5900a07f2f8..bd75e0e6430ff6e536f0b10d28cc4793d0f7fe6c 100755 (executable)
@@ -57,7 +57,7 @@ test_expect_success FILEMODE 'verify executable bit on file' '
        test -x file2
 '
 
-test_expect_failure 'merging with triple rename across D/F conflict' '
+test_expect_success 'merging with triple rename across D/F conflict' '
        git reset --hard HEAD &&
        git checkout -b main &&
        git rm -rf . &&