diff options
author | Elijah Newren <newren@gmail.com> | 2011-08-12 09:19:48 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-15 01:19:33 +0400 |
commit | 7dd9c304be5f9299d7b4b8ddb59072f774ecf081 (patch) | |
tree | d35a7c37ab6670b958f8554f31dbb51607ba88da /t | |
parent | f1a0f457b3d3cf3b4acea2addc1e26e7b931d474 (diff) |
t6022: Add testcase for merging a renamed file with a simple change
This is a testcase that was broken by b2c8c0a (merge-recursive: When we
detect we can skip an update, actually skip it 2011-02-28) and fixed by
6db4105 (Revert "Merge branch 'en/merge-recursive'" 2011-05-19). Include
this testcase to ensure we don't regress it again.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t6022-merge-rename.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh index 11c5c60fff..6ff4bd26ad 100755 --- a/t/t6022-merge-rename.sh +++ b/t/t6022-merge-rename.sh @@ -673,4 +673,31 @@ test_expect_failure 'avoid unnecessary update, with D/F conflict' ' test_cmp expect actual # "df" should have stayed intact ' +test_expect_success 'setup merge of rename + small change' ' + git reset --hard && + git checkout --orphan rename-plus-small-change && + git rm -rf . && + git clean -fdqx && + + echo ORIGINAL >file && + git add file && + + test_tick && + git commit -m Initial && + git checkout -b rename_branch && + git mv file renamed_file && + git commit -m Rename && + git checkout rename-plus-small-change && + echo NEW-VERSION >file && + git commit -a -m Reformat +' + +test_expect_success 'merge rename + small change' ' + git merge rename_branch && + + test 1 -eq $(git ls-files -s | wc -l) && + test 0 -eq $(git ls-files -o | wc -l) && + test $(git rev-parse HEAD:renamed_file) = $(git rev-parse HEAD~1:file) +' + test_done |