summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-02-24 22:54:00 -0800
committerJunio C Hamano <gitster@pobox.com>2023-02-24 22:54:00 -0800
commitd180cc297922569e530da843bee4df3964167dea (patch)
tree85a377687a1b6a5ed5e9e71fa145e2020d01d5df /builtin
parentc5f7ef5fdc2d60af86669931829e4da57e2eed68 (diff)
parentc39952b925ccf59e49f3c174861a862dc1721492 (diff)
downloadgit-d180cc297922569e530da843bee4df3964167dea.tar.gz
Merge branch 'ma/fetch-parallel-use-online-cpus'
"git fetch --jobs=0" used to hit a BUG(), which has been corrected to use the available CPUs. * ma/fetch-parallel-use-online-cpus: fetch: choose a sensible default with --jobs=0 again
Diffstat (limited to 'builtin')
-rw-r--r--builtin/fetch.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index a21ce89312..a09606b472 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -2196,6 +2196,9 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
if (dry_run)
write_fetch_head = 0;
+ if (!max_jobs)
+ max_jobs = online_cpus();
+
if (!git_config_get_string_tmp("fetch.bundleuri", &bundle_uri) &&
fetch_bundle_uri(the_repository, bundle_uri, NULL))
warning(_("failed to fetch bundles from '%s'"), bundle_uri);