X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=builtin%2Fprune.c;h=b99b635e44f6145395b5c761505099c0a0f5b6cc;hb=f524129737d9ba3e685c31bacde844ec1db1fea9;hp=e65690ba370511072dfa1e64838eef5e5686aac9;hpb=6d1cdadbeeb03f40250526e29b1f1a91582911d8;p=git.git diff --git a/builtin/prune.c b/builtin/prune.c index e65690ba3..b99b635e4 100644 --- a/builtin/prune.c +++ b/builtin/prune.c @@ -5,6 +5,7 @@ #include "builtin.h" #include "reachable.h" #include "parse-options.h" +#include "progress.h" #include "dir.h" static const char * const prune_usage[] = { @@ -14,6 +15,7 @@ static const char * const prune_usage[] = { static int show_only; static int verbose; static unsigned long expire; +static int show_progress = -1; static int prune_tmp_object(const char *path, const char *filename) { @@ -83,9 +85,9 @@ static int prune_dir(int i, char *path) } fprintf(stderr, "bad sha1 file: %s/%s\n", path, de->d_name); } + closedir(dir); if (!show_only) rmdir(path); - closedir(dir); return 0; } @@ -124,9 +126,11 @@ static void remove_temporary_files(const char *path) int cmd_prune(int argc, const char **argv, const char *prefix) { struct rev_info revs; + struct progress *progress = NULL; const struct option options[] = { OPT__DRY_RUN(&show_only, "do not remove, show only"), OPT__VERBOSE(&verbose, "report pruned objects"), + OPT_BOOL(0, "progress", &show_progress, "show progress"), OPT_DATE(0, "expire", &expire, "expire objects older than