]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3600-rm.sh
builtin-rm: fix index lock file path
[thirdparty/git.git] / t / t3600-rm.sh
index f542f0af41989aee51f75b9844abf97943d9e33f..7893d8c40ea510595b0483432e71a74b11b24598 100755 (executable)
@@ -217,4 +217,16 @@ test_expect_success 'Remove nonexistent file returns nonzero exit status' '
        ! git rm nonexistent
 '
 
+test_expect_success 'Call "rm" from outside the work tree' '
+       mkdir repo &&
+       cd repo &&
+       git init &&
+       echo something > somefile &&
+       git add somefile &&
+       git commit -m "add a file" &&
+       (cd .. &&
+        git --git-dir=repo/.git --work-tree=repo rm somefile) &&
+       test_must_fail git ls-files --error-unmatch somefile
+'
+
 test_done