X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=prune-packed.c;h=26123f7f6bb8bf9cc7fc27905fe2b67d66646f05;hb=3dd94e3b2e2f5b00512273f96ab5628c742c112c;hp=5306e8e5ef411bfa7e6bcf4ba0639e640592818b;hpb=51890a64eb152fb914d0dd3676f549ab8d8cc49a;p=git.git diff --git a/prune-packed.c b/prune-packed.c index 5306e8e5..26123f7f 100644 --- a/prune-packed.c +++ b/prune-packed.c @@ -26,6 +26,8 @@ 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; + rmdir(pathname); } static void prune_packed_objects(void) @@ -46,7 +48,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); } @@ -69,6 +71,7 @@ int main(int argc, char **argv) /* Handle arguments here .. */ usage(prune_packed_usage); } + sync(); prune_packed_objects(); return 0; }