MCPcopy Create free account
hub / github.com/git/git / run_parallel_checkout

Function run_parallel_checkout

parallel-checkout.c:651–678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

649}
650
651int run_parallel_checkout(struct checkout *state, int num_workers, int threshold,
652 struct progress *progress, unsigned int *progress_cnt)
653{
654 int ret;
655
656 if (parallel_checkout.status != PC_ACCEPTING_ENTRIES)
657 BUG("cannot run parallel checkout: uninitialized or already running");
658
659 parallel_checkout.status = PC_RUNNING;
660 parallel_checkout.progress = progress;
661 parallel_checkout.progress_cnt = progress_cnt;
662
663 if (parallel_checkout.nr < num_workers)
664 num_workers = parallel_checkout.nr;
665
666 if (num_workers <= 1 || parallel_checkout.nr < threshold) {
667 write_items_sequentially(state);
668 } else {
669 struct pc_worker *workers = setup_workers(state, num_workers);
670 gather_results_from_workers(workers, num_workers);
671 finish_workers(workers, num_workers);
672 }
673
674 ret = handle_results(state);
675
676 finish_parallel_checkout();
677 return ret;
678}

Callers 3

check_updatesFunction · 0.85
cmd_checkout_indexFunction · 0.85
checkout_worktreeFunction · 0.85

Calls 6

write_items_sequentiallyFunction · 0.85
setup_workersFunction · 0.85
finish_workersFunction · 0.85
handle_resultsFunction · 0.85
finish_parallel_checkoutFunction · 0.85

Tested by

no test coverage detected