diff options
Diffstat (limited to 't/t3600-rm.sh')
-rwxr-xr-x | t/t3600-rm.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh index 66aca99fd3..95542e9cfe 100755 --- a/t/t3600-rm.sh +++ b/t/t3600-rm.sh @@ -187,6 +187,19 @@ test_expect_success 'but with -f it should work.' ' test_must_fail git ls-files --error-unmatch baz ' +test_expect_success 'refuse to remove cached empty file with modifications' ' + >empty && + git add empty && + echo content >empty && + test_must_fail git rm --cached empty +' + +test_expect_success 'remove intent-to-add file without --force' ' + echo content >intent-to-add && + git add -N intent-to-add + git rm --cached intent-to-add +' + test_expect_success 'Recursive test setup' ' mkdir -p frotz && echo qfwfq >frotz/nitfol && @@ -238,4 +251,21 @@ test_expect_success 'refresh index before checking if it is up-to-date' ' ' +test_expect_success 'choking "git rm" should not let it die with cruft' ' + git reset -q --hard && + H=0000000000000000000000000000000000000000 && + i=0 && + while test $i -lt 12000 + do + echo "100644 $H 0 some-file-$i" + i=$(( $i + 1 )) + done | git update-index --index-info && + git rm -n "some-file-*" | :; + test -f .git/index.lock + status=$? + rm -f .git/index.lock + git reset -q --hard + test "$status" != 0 +' + test_done |