Skip to content

Commit

Permalink
merge-recursive: Fix multiple file rename across D/F conflict
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Elijah Newren authored and Junio C Hamano committed Aug 18, 2010
1 parent 5601ba6 commit ae74548
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions merge-recursive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion t/t6031-merge-recursive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 . &&
Expand Down

0 comments on commit ae74548

Please sign in to comment.