From 5601ba6574cfbd1249a6d38b72159a7d3ccf8315 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Tue, 17 Aug 2010 17:53:18 -0600 Subject: t6031: Add a testcase covering multiple renames across a D/F conflict Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- t/t6031-merge-recursive.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 't/t6031-merge-recursive.sh') diff --git a/t/t6031-merge-recursive.sh b/t/t6031-merge-recursive.sh index 8a3304fb0b..c50ee295a7 100755 --- a/t/t6031-merge-recursive.sh +++ b/t/t6031-merge-recursive.sh @@ -57,4 +57,35 @@ test_expect_success FILEMODE 'verify executable bit on file' ' test -x file2 ' +test_expect_failure 'merging with triple rename across D/F conflict' ' + git reset --hard HEAD && + git checkout -b main && + git rm -rf . && + + echo "just a file" >sub1 && + mkdir -p sub2 && + echo content1 >sub2/file1 && + echo content2 >sub2/file2 && + echo content3 >sub2/file3 && + mkdir simple && + echo base >simple/bar && + git add -A && + test_tick && + git commit -m base && + + git checkout -b other && + echo more >>simple/bar && + test_tick && + git commit -a -m changesimplefile && + + git checkout main && + git rm sub1 && + git mv sub2 sub1 && + test_tick && + git commit -m changefiletodir && + + test_tick && + git merge other +' + test_done -- cgit v1.2.1 From ae745487ad7a4ceca0e903da6df21be2c1ebfc29 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Tue, 17 Aug 2010 17:53:19 -0600 Subject: 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 Signed-off-by: Junio C Hamano --- t/t6031-merge-recursive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/t6031-merge-recursive.sh') diff --git a/t/t6031-merge-recursive.sh b/t/t6031-merge-recursive.sh index c50ee295a7..bd75e0e643 100755 --- a/t/t6031-merge-recursive.sh +++ b/t/t6031-merge-recursive.sh @@ -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 . && -- cgit v1.2.1