summaryrefslogtreecommitdiff
path: root/builtin/gc.c
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2021-04-16 12:49:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-04-16 20:36:55 (GMT)
commit32f67888d85bd0af30b857a29ca25a55999b6d01 (patch)
treed0ac80a58292ef6bee2faade6fea392045c44032 /builtin/gc.c
parentcfd781ea22e0f334d3c0104e1f34c47327934314 (diff)
downloadgit-32f67888d85bd0af30b857a29ca25a55999b6d01.zip
git-32f67888d85bd0af30b857a29ca25a55999b6d01.tar.gz
git-32f67888d85bd0af30b857a29ca25a55999b6d01.tar.bz2
maintenance: respect remote.*.skipFetchAll
If a remote has the skipFetchAll setting enabled, then that remote is not intended for frequent fetching. It makes sense to not fetch that data during the 'prefetch' maintenance task. Skip that remote in the iteration without error. The skip_default_update member is initialized in remote.c:handle_config() as part of initializing the 'struct remote'. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/gc.c')
-rw-r--r--builtin/gc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/gc.c b/builtin/gc.c
index 9d35f7d..98a8031 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -878,6 +878,9 @@ static int fetch_remote(struct remote *remote, void *cbdata)
struct maintenance_run_opts *opts = cbdata;
struct child_process child = CHILD_PROCESS_INIT;
+ if (remote->skip_default_update)
+ return 0;
+
child.git_cmd = 1;
strvec_pushl(&child.args, "fetch", remote->name,
"--prefetch", "--prune", "--no-tags",