X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=prune-packed.c;h=1e0fc0cd9e9694c0bad54e26367097cc499bf3d2;hb=f1a906a387a2155069e02b09c33dabd6d058ede5;hp=5306e8e5ef411bfa7e6bcf4ba0639e640592818b;hpb=51017101c7a308745ba3c04944457f1dc6a55780;p=git.git diff --git a/prune-packed.c b/prune-packed.c index 5306e8e5..1e0fc0cd 100644 --- a/prune-packed.c +++ b/prune-packed.c @@ -26,6 +26,9 @@ static void prune_dir(int i, DIR *dir, char *pathname, int len) else if (unlink(pathname) < 0) error("unable to unlink %s", pathname); } + pathname[len] = 0; + if (!rmdir(pathname)) + mkdir(pathname, 0777); } static void prune_packed_objects(void) @@ -46,7 +49,7 @@ static void prune_packed_objects(void) sprintf(pathname + len, "%02x/", i); d = opendir(pathname); if (!d) - die("unable to open %s", pathname); + continue; prune_dir(i, d, pathname, len + 3); closedir(d); }