summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2010-02-19 05:57:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-02-19 06:22:22 (GMT)
commit3fc0d131c573f6f774e2e4abba9cbda694b08321 (patch)
treef15d2c7a0f6b868656dec035b3db98d54d0be6b4 /t
parentf01f1099f40f24fe6f7802185340a6fa3a3d4f35 (diff)
downloadgit-3fc0d131c573f6f774e2e4abba9cbda694b08321.zip
git-3fc0d131c573f6f774e2e4abba9cbda694b08321.tar.gz
git-3fc0d131c573f6f774e2e4abba9cbda694b08321.tar.bz2
rm: fix bug in recursive subdirectory removal
If we remove a path in a/deep/subdirectory, we should try to remove as many trailing components as possible (i.e., subdirectory, then deep, then a). However, the test for the return value of rmdir was reversed, so we only ever deleted at most one level. The fix is in remove_path, so "apply" and "merge-recursive" also are fixed. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t3600-rm.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index 76b1bb4..0aaf0ad 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -271,4 +271,12 @@ test_expect_success 'choking "git rm" should not let it die with cruft' '
test "$status" != 0
'
+test_expect_success 'rm removes subdirectories recursively' '
+ mkdir -p dir/subdir/subsubdir &&
+ echo content >dir/subdir/subsubdir/file &&
+ git add dir/subdir/subsubdir/file &&
+ git rm -f dir/subdir/subsubdir/file &&
+ ! test -d dir
+'
+
test_done