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>
This commit is contained in:

committed by
Junio C Hamano

parent
2352570bf4
commit
0235017eaf
@ -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
|
||||
|
Reference in New Issue
Block a user