summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-09-20 15:20:41 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-09-20 15:20:41 -0700
commitdf0c308c1a165e277ef3a7b8ae1457b926936d99 (patch)
tree6964b83ee77096a6895e26d6ea2e444974dd0ec8
parentMerge branch 'dt/submodule-diff-fixes' (diff)
parententry: show finer-grained counter in "Filtering content" progress line (diff)
downloadtgif-df0c308c1a165e277ef3a7b8ae1457b926936d99.tar.xz
Merge branch 'ab/progress-users-adjust-counters'
The code to show progress indicator in a few code paths did not cover between 0-100%, which has been corrected. * ab/progress-users-adjust-counters: entry: show finer-grained counter in "Filtering content" progress line commit-graph: fix bogus counter in "Scanning merged commits" progress line
-rw-r--r--commit-graph.c2
-rw-r--r--entry.c12
2 files changed, 6 insertions, 8 deletions
diff --git a/commit-graph.c b/commit-graph.c
index 00614acd65..4617059220 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -2125,7 +2125,7 @@ static void sort_and_scan_merged_commits(struct write_commit_graph_context *ctx)
ctx->num_extra_edges = 0;
for (i = 0; i < ctx->commits.nr; i++) {
- display_progress(ctx->progress, i);
+ display_progress(ctx->progress, i + 1);
if (i && oideq(&ctx->commits.list[i - 1]->object.oid,
&ctx->commits.list[i]->object.oid)) {
diff --git a/entry.c b/entry.c
index 044e8ec92c..9b0f968a70 100644
--- a/entry.c
+++ b/entry.c
@@ -163,24 +163,21 @@ int finish_delayed_checkout(struct checkout *state, int *nr_checkouts,
int show_progress)
{
int errs = 0;
- unsigned delayed_object_count;
+ unsigned processed_paths = 0;
off_t filtered_bytes = 0;
struct string_list_item *filter, *path;
- struct progress *progress;
+ struct progress *progress = NULL;
struct delayed_checkout *dco = state->delayed_checkout;
if (!state->delayed_checkout)
return errs;
dco->state = CE_RETRY;
- delayed_object_count = dco->paths.nr;
- progress = show_progress
- ? start_delayed_progress(_("Filtering content"), delayed_object_count)
- : NULL;
+ if (show_progress)
+ progress = start_delayed_progress(_("Filtering content"), dco->paths.nr);
while (dco->filters.nr > 0) {
for_each_string_list_item(filter, &dco->filters) {
struct string_list available_paths = STRING_LIST_INIT_NODUP;
- display_progress(progress, delayed_object_count - dco->paths.nr);
if (!async_query_available_blobs(filter->string, &available_paths)) {
/* Filter reported an error */
@@ -227,6 +224,7 @@ int finish_delayed_checkout(struct checkout *state, int *nr_checkouts,
ce = index_file_exists(state->istate, path->string,
strlen(path->string), 0);
if (ce) {
+ display_progress(progress, ++processed_paths);
errs |= checkout_entry(ce, state, NULL, nr_checkouts);
filtered_bytes += ce->ce_stat_data.sd_size;
display_throughput(progress, filtered_bytes);