fix deletion of .git/objects sub-directories in git-prune/repack
authorKarsten Blees <redacted>
Tue, 6 Mar 2012 09:18:41 +0000 (10:18 +0100)
committerJunio C Hamano <redacted>
Wed, 7 Mar 2012 18:24:33 +0000 (10:24 -0800)
commitd34e70d6b89b33c398403e872c0dd751d44c7844
treeb674f854d00d2145951d93076eb5f5c426d8de24
parent0dbe6592ccbd1a394a69a52074e3729d546fe952
fix deletion of .git/objects sub-directories in git-prune/repack

Both git-prune and git-repack (and thus, git-gc) try to rmdir while
holding a DIR* handle on the directory.  This can leave dangling
empty directories in the .git/objects on platforms where directory
cannot be removed while they are open.

First call closedir() and then rmdir(); that is more logical ordering.

Reported-by: John Chen <redacted>
Reported-by: Stefan Naewe <redacted>
Signed-off-by: Karsten Blees <redacted>
Improved-and-Acked-by: Johannes Sixt <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/prune-packed.c
builtin/prune.c
git clone https://git.99rst.org/PROJECT