Skip to content

Commit df0c308

Browse files
committed
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
2 parents 75405e7 + bf6d819 commit df0c308

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

commit-graph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,7 @@ static void sort_and_scan_merged_commits(struct write_commit_graph_context *ctx)
21252125

21262126
ctx->num_extra_edges = 0;
21272127
for (i = 0; i < ctx->commits.nr; i++) {
2128-
display_progress(ctx->progress, i);
2128+
display_progress(ctx->progress, i + 1);
21292129

21302130
if (i && oideq(&ctx->commits.list[i - 1]->object.oid,
21312131
&ctx->commits.list[i]->object.oid)) {

entry.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,24 +163,21 @@ int finish_delayed_checkout(struct checkout *state, int *nr_checkouts,
163163
int show_progress)
164164
{
165165
int errs = 0;
166-
unsigned delayed_object_count;
166+
unsigned processed_paths = 0;
167167
off_t filtered_bytes = 0;
168168
struct string_list_item *filter, *path;
169-
struct progress *progress;
169+
struct progress *progress = NULL;
170170
struct delayed_checkout *dco = state->delayed_checkout;
171171

172172
if (!state->delayed_checkout)
173173
return errs;
174174

175175
dco->state = CE_RETRY;
176-
delayed_object_count = dco->paths.nr;
177-
progress = show_progress
178-
? start_delayed_progress(_("Filtering content"), delayed_object_count)
179-
: NULL;
176+
if (show_progress)
177+
progress = start_delayed_progress(_("Filtering content"), dco->paths.nr);
180178
while (dco->filters.nr > 0) {
181179
for_each_string_list_item(filter, &dco->filters) {
182180
struct string_list available_paths = STRING_LIST_INIT_NODUP;
183-
display_progress(progress, delayed_object_count - dco->paths.nr);
184181

185182
if (!async_query_available_blobs(filter->string, &available_paths)) {
186183
/* Filter reported an error */
@@ -227,6 +224,7 @@ int finish_delayed_checkout(struct checkout *state, int *nr_checkouts,
227224
ce = index_file_exists(state->istate, path->string,
228225
strlen(path->string), 0);
229226
if (ce) {
227+
display_progress(progress, ++processed_paths);
230228
errs |= checkout_entry(ce, state, NULL, nr_checkouts);
231229
filtered_bytes += ce->ce_stat_data.sd_size;
232230
display_throughput(progress, filtered_bytes);

0 commit comments

Comments
 (0)