diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2011-11-05 19:00:08 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-11-07 22:12:19 -0800 |
commit | dc347195ccfbc87b6e445f5c31a5500e1df6c9b5 (patch) | |
tree | 88de64bfe9c15cb9d97e05afd8fa5e99cff7f45a /builtin/prune.c | |
parent | b04ba2bb42957f63567f530e092385f085b25e63 (diff) | |
download | git-dc347195ccfbc87b6e445f5c31a5500e1df6c9b5.tar.gz git-dc347195ccfbc87b6e445f5c31a5500e1df6c9b5.tar.xz |
prune: show progress while marking reachable objects
prune already shows progress meter while pruning. The marking part may
take a few seconds or more, depending on repository size. Show
progress meter during this time too.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/prune.c')
-rw-r--r-- | builtin/prune.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin/prune.c b/builtin/prune.c index e65690ba3..6b39d3fde 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[] = { @@ -124,6 +125,7 @@ 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; const struct option options[] = { OPT__DRY_RUN(&show_only, "do not remove, show only"), OPT__VERBOSE(&verbose, "report pruned objects"), @@ -152,7 +154,9 @@ int cmd_prune(int argc, const char **argv, const char *prefix) else die("unrecognized argument: %s", name); } - mark_reachable_objects(&revs, 1); + progress = start_progress_delay("Checking connectivity", 0, 0, 2); + mark_reachable_objects(&revs, 1, progress); + stop_progress(&progress); prune_object_dir(get_object_directory()); prune_packed_objects(show_only); |