summaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorMatheus Tavares <matheus.bernardino@usp.br>2021-04-19 00:14:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-04-19 18:57:05 (GMT)
commit1c4d6f46be8dc05c9a49379587ffd454e92b72cf (patch)
tree940731bcc592e24c773c02ddc6d6ffc3324b5d38 /unpack-trees.c
parent7531e4b66e8c175707b6915df10666fbb5b7859f (diff)
downloadgit-1c4d6f46be8dc05c9a49379587ffd454e92b72cf.zip
git-1c4d6f46be8dc05c9a49379587ffd454e92b72cf.tar.gz
git-1c4d6f46be8dc05c9a49379587ffd454e92b72cf.tar.bz2
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.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 0669748..4b77e52 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);