summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar SZEDER Gábor <szeder.dev@gmail.com>2019-04-01 01:12:35 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-04-01 18:08:05 +0900
commit79e3aa66244af40bd3c8999e00308f96748367d0 (patch)
tree2096ff838ec6abb6927b3fbd0ab54e92a643006c
parentThe third batch (diff)
downloadtgif-79e3aa66244af40bd3c8999e00308f96748367d0.tar.xz
index-pack: show progress while checking objects
When 'git index-pack' is run by 'git clone', its check_objects() function usually doesn't take long enough to be a concern, but I just run into a situation where it took about a minute or so: I inadvertently put some memory pressure on my tiny laptop while cloning linux.git, and then there was quite a long silence between the "Resolving deltas" and "Checking connectivity" progress bars. Show a progress bar during the loop of check_objects() to let the user know that something is still going on. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/index-pack.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 31046c7a0a..ccf4eb7e9b 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -219,8 +219,16 @@ static unsigned check_objects(void)
unsigned i, max, foreign_nr = 0;
max = get_max_object_index();
- for (i = 0; i < max; i++)
+
+ if (verbose)
+ progress = start_delayed_progress(_("Checking objects"), max);
+
+ for (i = 0; i < max; i++) {
foreign_nr += check_object(get_indexed_object(i));
+ display_progress(progress, i + 1);
+ }
+
+ stop_progress(&progress);
return foreign_nr;
}