Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerrick Stolee <derrickstolee@github.com>2023-03-31 18:59:04 +0300
committerJunio C Hamano <gitster@pobox.com>2023-03-31 20:07:33 +0300
commit25bccb4b79dce1d5c259228ef3c91eadcd13d8ac (patch)
tree3ce494cb3a51ccb7a49c3bad5f744969b65ebe8c /bundle-uri.c
parent6369acd968d02899973a9a853c48029b92cea401 (diff)
fetch: download bundles once, even with --all
When fetch.bundleURI is set, 'git fetch' downloads bundles from the given bundle URI before fetching from the specified remote. However, when using non-file remotes, 'git fetch --all' will launch 'git fetch' subprocesses which then read fetch.bundleURI and fetch the bundle list again. We do not expect the bundle list to have new information during these multiple runs, so avoid these extra calls by un-setting fetch.bundleURI in the subprocess arguments. Be careful to skip fetching bundles for the empty bundle string. Fetching bundles from the empty list presents some interesting test failures. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bundle-uri.c')
-rw-r--r--bundle-uri.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/bundle-uri.c b/bundle-uri.c
index 177c181040..56390651b9 100644
--- a/bundle-uri.c
+++ b/bundle-uri.c
@@ -792,6 +792,15 @@ int fetch_bundle_uri(struct repository *r, const char *uri,
init_bundle_list(&list);
+ /*
+ * Do not fetch a NULL or empty bundle URI. An empty bundle URI
+ * could signal that a configured bundle URI has been disabled.
+ */
+ if (!uri || !*uri) {
+ result = 0;
+ goto cleanup;
+ }
+
/* If a bundle is added to this global list, then it is required. */
list.mode = BUNDLE_MODE_ALL;