Skip to content

Commit ae74548

Browse files
newrengitster
authored andcommitted
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>
1 parent 5601ba6 commit ae74548

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

merge-recursive.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,7 @@ static int process_renames(struct merge_options *o,
10201020
if (mfi.clean &&
10211021
sha_eq(mfi.sha, ren1->pair->two->sha1) &&
10221022
mfi.mode == ren1->pair->two->mode) {
1023+
int i;
10231024
/*
10241025
* This message is part of
10251026
* t6022 test. If you change

t/t6031-merge-recursive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ test_expect_success FILEMODE 'verify executable bit on file' '
5757
test -x file2
5858
'
5959

60-
test_expect_failure 'merging with triple rename across D/F conflict' '
60+
test_expect_success 'merging with triple rename across D/F conflict' '
6161
git reset --hard HEAD &&
6262
git checkout -b main &&
6363
git rm -rf . &&

0 commit comments

Comments
 (0)