Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Riesen <raa.lkml@gmail.com>2011-04-01 12:29:16 +0400
committerJunio C Hamano <gitster@pobox.com>2011-04-01 22:16:21 +0400
commit0235017eafa8dfc3a7353b7091ad5109d0beb7a5 (patch)
treef62dcba6b55c4043600bbd0620b91e54c885b129 /t/t7300-clean.sh
parent2352570bf43368f3d3931f7b24bb7fd44e68eef3 (diff)
clean: unreadable directory may still be rmdir-able if it is empty
As a last ditch effort, try rmdir(2) when we cannot read the directory to be removed. It may be an empty directory that we can remove without any permission, as long as we can modify its parent directory. Noticed by Linus. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7300-clean.sh')
-rwxr-xr-xt/t7300-clean.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index 02f67b73b7..9b12681f97 100755
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
@@ -453,4 +453,11 @@ test_expect_success 'git clean -e' '
)
'
+test_expect_success SANITY 'git clean -d with an unreadable empty directory' '
+ mkdir foo &&
+ chmod a= foo &&
+ git clean -dfx foo &&
+ ! test -d foo
+'
+
test_done