X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=prune-packed.c;h=d24b097114ef2610416b106ea9aa2000873924f3;hb=7612a1efdb0c0806b43db10ce784707aae874340;hp=73f0f3a46277e9053d97590f8e2200477fe247e3;hpb=230f13225df8b7e7eb0acc91a8c630f9e84967c1;p=git.git diff --git a/prune-packed.c b/prune-packed.c index 73f0f3a4..d24b0971 100644 --- a/prune-packed.c +++ b/prune-packed.c @@ -27,8 +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)) - mkdir(pathname, 0777); + rmdir(pathname); } static void prune_packed_objects(void) @@ -59,6 +58,8 @@ int main(int argc, char **argv) { int i; + setup_git_directory(); + for (i = 1; i < argc; i++) { const char *arg = argv[i]; @@ -72,6 +73,7 @@ int main(int argc, char **argv) /* Handle arguments here .. */ usage(prune_packed_usage); } + sync(); prune_packed_objects(); return 0; }