summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Elijah Newren <newren@gmail.com>2011-08-11 23:20:24 -0600
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-08-14 14:19:39 -0700
commit3f680ff0cf41c80b5c3a7ef4e7b417c0aa788dfb (patch)
treea3a8f78659a53f913fc532f7c6287236efb90985
parentt3030: fix accidental success in symlink rename (diff)
downloadtgif-3f680ff0cf41c80b5c3a7ef4e7b417c0aa788dfb.tar.xz
t6022: Add testcase for spurious "refusing to lose untracked" messages
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t6022-merge-rename.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh
index 74dcf20b88..0fd2b0a10e 100755
--- a/t/t6022-merge-rename.sh
+++ b/t/t6022-merge-rename.sh
@@ -767,4 +767,30 @@ test_expect_success 'merge rename into master has correct extended markers' '
test_cmp expected renamed_file
'
+test_expect_success 'setup spurious "refusing to lose untracked" message' '
+ git rm -rf . &&
+ git clean -fdqx &&
+ rm -rf .git &&
+ git init &&
+
+ > irrelevant_file &&
+ printf "1\n2\n3\n4\n5\n6\n7\n8\n" >original_file &&
+ git add irrelevant_file original_file &&
+ git commit -mA &&
+
+ git checkout -b rename &&
+ git mv original_file renamed_file &&
+ git commit -mB &&
+
+ git checkout master &&
+ git rm original_file &&
+ git commit -mC
+'
+
+test_expect_failure 'no spurious "refusing to lose untracked" message' '
+ git checkout master^0 &&
+ test_must_fail git merge rename^0 2>errors.txt &&
+ ! grep "refusing to lose untracked file" errors.txt
+'
+
test_done