diff options
author | Elijah Newren <newren@gmail.com> | 2011-08-12 09:19:34 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-15 01:19:31 +0400 |
commit | 695576fddd039b2fdc3cad52bbaab4d89e27b71c (patch) | |
tree | ed49ce8831903fdc7060a7e73871e422a924c4ae /t/t6042-merge-rename-corner-cases.sh | |
parent | d8ead15963890a42f99fd0e7f3192b55cacd9404 (diff) |
t6042: Add a testcase where git deletes an untracked file
Current git will nuke an untracked file during a rename/delete conflict if
(a) there is an untracked file whose name matches the source of a rename
and (b) the merge is done in a certain direction. Add a simple testcase
demonstrating this bug.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6042-merge-rename-corner-cases.sh')
-rwxr-xr-x | t/t6042-merge-rename-corner-cases.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/t/t6042-merge-rename-corner-cases.sh b/t/t6042-merge-rename-corner-cases.sh new file mode 100755 index 0000000000..5054459987 --- /dev/null +++ b/t/t6042-merge-rename-corner-cases.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +test_description="recursive merge corner cases w/ renames but not criss-crosses" +# t6036 has corner cases that involve both criss-cross merges and renames + +. ./test-lib.sh + +test_expect_success 'setup rename/delete + untracked file' ' + echo "A pretty inscription" >ring && + git add ring && + test_tick && + git commit -m beginning && + + git branch people && + git checkout -b rename-the-ring && + git mv ring one-ring-to-rule-them-all && + test_tick && + git commit -m fullname && + + git checkout people && + git rm ring && + echo gollum >owner && + git add owner && + test_tick && + git commit -m track-people-instead-of-objects && + echo "Myyy PRECIOUSSS" >ring +' + +test_expect_failure "Does git preserve Gollum's precious artifact?" ' + test_must_fail git merge -s recursive rename-the-ring && + + # Make sure git did not delete an untracked file + test -f ring +' + +test_done |