diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-05-04 14:57:06 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-05-04 14:57:06 -0700 |
commit | 391b4933442dd07507a5de112092eaa4efc902bb (patch) | |
tree | bae576a334e6e8941aa3997555b3c7e78aa4b242 | |
parent | a3402c18b66347a9357cdb1af5a581f1ecc5264d (diff) | |
parent | 0235017eafa8dfc3a7353b7091ad5109d0beb7a5 (diff) | |
download | git-391b4933442dd07507a5de112092eaa4efc902bb.tar.gz |
Merge branch 'ar/clean-rmdir-empty' into maint
* ar/clean-rmdir-empty:
clean: unreadable directory may still be rmdir-able if it is empty
-rw-r--r-- | dir.c | 2 | ||||
-rwxr-xr-x | t/t7300-clean.sh | 7 |
2 files changed, 8 insertions, 1 deletions
@@ -1192,7 +1192,7 @@ int remove_dir_recursively(struct strbuf *path, int flag) 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 7e1be44402..800b5368a5 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 |