diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-03-09 21:21:21 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-03-09 21:21:21 +0300 |
commit | 4a5c3e10f2a17efbbef72b7112d4d036ec89eceb (patch) | |
tree | 47d6632e0599c2298f146ad49b160a8636d748ab /walker.c | |
parent | 3658d77f8e563e77658d9e44df5e24f08ca99e3a (diff) | |
parent | 7655b4119d49844e6ebc62da571e5f18528dbde8 (diff) |
Merge branch 'rs/show-progress-in-dumb-http-fetch'
"git fetch" over HTTP walker protocol did not show any progress
output. We inherently do not know how much work remains, but still
we can show something not to bore users.
* rs/show-progress-in-dumb-http-fetch:
remote-curl: show progress for fetches over dumb HTTP
Diffstat (limited to 'walker.c')
-rw-r--r-- | walker.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -8,6 +8,7 @@ #include "tag.h" #include "blob.h" #include "refs.h" +#include "progress.h" static struct object_id current_commit_oid; @@ -162,6 +163,11 @@ static int process(struct walker *walker, struct object *obj) static int loop(struct walker *walker) { struct object_list *elem; + struct progress *progress = NULL; + uint64_t nr = 0; + + if (walker->get_progress) + progress = start_delayed_progress(_("Fetching objects"), 0); while (process_queue) { struct object *obj = process_queue->item; @@ -176,15 +182,20 @@ static int loop(struct walker *walker) */ if (! (obj->flags & TO_SCAN)) { if (walker->fetch(walker, obj->oid.hash)) { + stop_progress(&progress); report_missing(obj); return -1; } } if (!obj->type) parse_object(the_repository, &obj->oid); - if (process_object(walker, obj)) + if (process_object(walker, obj)) { + stop_progress(&progress); return -1; + } + display_progress(progress, ++nr); } + stop_progress(&progress); return 0; } |