X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=prune-packed.c;h=d24b097114ef2610416b106ea9aa2000873924f3;hb=fb6a9f93d39e4e5fdb83673a927f71a34e9fb7c0;hp=73f0f3a46277e9053d97590f8e2200477fe247e3;hpb=f865a2ad981f72423aa1c19412ce57c543801957;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; }