Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'ar/clean-rmdir-empty' into maint
author
Junio C Hamano
<gitster@pobox.com>
Wed, 4 May 2011 21:57:06 +0000
(14:57 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 4 May 2011 21:57:06 +0000
(14:57 -0700)
* ar/clean-rmdir-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
raw
(from parent 1:
a3402c1
)
diff --git
a/dir.c
b/dir.c
index 325fb56ad395c9b47dcbdea47b2833a4287198bc..532bcb65b523223b66efd3f4e458f62fcbe0d6a5 100644
(file)
--- a/
dir.c
+++ b/
dir.c
@@
-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 7e1be444027621e1ea94b0b9ed0e129fce922b02..800b5368a5248835bb9817c0e0c8409131306b3c 100755
(executable)
--- 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