From 32f67888d85bd0af30b857a29ca25a55999b6d01 Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Fri, 16 Apr 2021 12:49:59 +0000 Subject: 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 Signed-off-by: Junio C Hamano --- t/t7900-maintenance.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 't/t7900-maintenance.sh') diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh index eadb800c08..b93ae014ee 100755 --- a/t/t7900-maintenance.sh +++ b/t/t7900-maintenance.sh @@ -153,7 +153,13 @@ test_expect_success 'prefetch multiple remotes' ' test_cmp_config refs/prefetch/ log.excludedecoration && git log --oneline --decorate --all >log && - ! grep "prefetch" log + ! grep "prefetch" log && + + test_when_finished git config --unset remote.remote1.skipFetchAll && + git config remote.remote1.skipFetchAll true && + GIT_TRACE2_EVENT="$(pwd)/skip-remote1.txt" git maintenance run --task=prefetch 2>/dev/null && + test_subcommand ! git fetch remote1 $fetchargs