diff options
author | Matheus Tavares <matheus.bernardino@usp.br> | 2021-04-18 21:14:56 -0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-04-19 11:57:05 -0700 |
commit | 1c4d6f46be8dc05c9a49379587ffd454e92b72cf (patch) | |
tree | 940731bcc592e24c773c02ddc6d6ffc3324b5d38 /unpack-trees.c | |
parent | 7531e4b66e8c175707b6915df10666fbb5b7859f (diff) | |
download | git-1c4d6f46be8dc05c9a49379587ffd454e92b72cf.tar.gz |
parallel-checkout: support progress displaying
Original-patch-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r-- | unpack-trees.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/unpack-trees.c b/unpack-trees.c index 0669748f21..4b77e52c6b 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -474,17 +474,22 @@ static int check_updates(struct unpack_trees_options *o, struct cache_entry *ce = index->cache[i]; if (ce->ce_flags & CE_UPDATE) { + size_t last_pc_queue_size = pc_queue_size(); + if (ce->ce_flags & CE_WT_REMOVE) BUG("both update and delete flags are set on %s", ce->name); - display_progress(progress, ++cnt); ce->ce_flags &= ~CE_UPDATE; errs |= checkout_entry(ce, &state, NULL, NULL); + + if (last_pc_queue_size == pc_queue_size()) + display_progress(progress, ++cnt); } } - stop_progress(&progress); if (pc_workers > 1) - errs |= run_parallel_checkout(&state, pc_workers, pc_threshold); + errs |= run_parallel_checkout(&state, pc_workers, pc_threshold, + progress, &cnt); + stop_progress(&progress); errs |= finish_delayed_checkout(&state, NULL); git_attr_set_direction(GIT_ATTR_CHECKIN); |