From: Junio C Hamano Date: Sun, 16 Oct 2005 21:09:50 +0000 (-0700) Subject: Sparse-directory safety fix. X-Git-Tag: v0.99.9~109 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b8041fe4d84bc75212cb6161d508fd1e9d2203ab;p=git.git Sparse-directory safety fix. This will be removed when merging the second phase of Linus' "Create object subdirectories on demand" change anyway, but the code to recreate the empty .git/objects/??/ directory was confused. Signed-off-by: Junio C Hamano --- diff --git a/prune-packed.c b/prune-packed.c index 73f0f3a46..1e0fc0cd9 100644 --- a/prune-packed.c +++ b/prune-packed.c @@ -27,7 +27,7 @@ static void prune_dir(int i, DIR *dir, char *pathname, int len) error("unable to unlink %s", pathname); } pathname[len] = 0; - if (rmdir(pathname)) + if (!rmdir(pathname)) mkdir(pathname, 0777); }