Code

Add an (optional, since expensive) test for >2gb clones
[git.git] / t / t3600-rm.sh
index b7d46e50a87f2609e67f595470021450b1f838a6..95542e9cfec1d7cc0631521c1c2bef3b7a139af7 100755 (executable)
@@ -251,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