author | Junio C Hamano <gitster@pobox.com> | |
Wed, 27 Apr 2011 18:36:41 +0000 (11:36 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 27 Apr 2011 18:36:41 +0000 (11:36 -0700) |
* ar/clean-rmdir-empty:
clean: unreadable directory may still be rmdir-able if it is empty
clean: unreadable directory may still be rmdir-able if it is empty
dir.c | patch | blob | history | |
t/t7300-clean.sh | patch | blob | history |
index 325fb56ad395c9b47dcbdea47b2833a4287198bc..532bcb65b523223b66efd3f4e458f62fcbe0d6a5 100644 (file)
--- a/dir.c
+++ b/dir.c
dir = opendir(path->buf);
if (!dir)
- return -1;
+ return rmdir(path->buf);
if (path->buf[original_len - 1] != '/')
strbuf_addch(path, '/');
diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index 7e1be444027621e1ea94b0b9ed0e129fce922b02..800b5368a5248835bb9817c0e0c8409131306b3c 100755 (executable)
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
)
'
+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