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

Function get_parallel_checkout_configs

parallel-checkout.c:44–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42static const int DEFAULT_NUM_WORKERS = 1;
43
44void get_parallel_checkout_configs(int *num_workers, int *threshold)
45{
46 char *env_workers = getenv("GIT_TEST_CHECKOUT_WORKERS");
47
48 if (env_workers && *env_workers) {
49 if (strtol_i(env_workers, 10, num_workers)) {
50 die(_("invalid value for '%s': '%s'"),
51 "GIT_TEST_CHECKOUT_WORKERS", env_workers);
52 }
53 if (*num_workers < 1)
54 *num_workers = online_cpus();
55
56 *threshold = 0;
57 return;
58 }
59
60 if (repo_config_get_int(the_repository, "checkout.workers", num_workers))
61 *num_workers = DEFAULT_NUM_WORKERS;
62 else if (*num_workers < 1)
63 *num_workers = online_cpus();
64
65 if (repo_config_get_int(the_repository, "checkout.thresholdForParallelism", threshold))
66 *threshold = DEFAULT_THRESHOLD_FOR_PARALLELISM;
67}
68
69void init_parallel_checkout(void)
70{

Callers 3

check_updatesFunction · 0.85
cmd_checkout_indexFunction · 0.85
checkout_worktreeFunction · 0.85

Calls 4

strtol_iFunction · 0.85
online_cpusFunction · 0.85
repo_config_get_intFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected