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:
authorEric Wong <e@80x24.org>2023-02-12 12:04:26 +0300
committerJunio C Hamano <gitster@pobox.com>2023-02-27 20:27:03 +0300
commitc6ce27ab08d30dd9d626d7a56cb928bc5792eb27 (patch)
treedb78da0e93422555f1e18788c91f2e5aaa64a2ff /t/t5510-fetch.sh
parentdadc8e6dacb629f46aee39bde90b6f09b73722eb (diff)
fetch: support hideRefs to speed up connectivity checks
With roughly 800 remotes all fetching into their own refs/remotes/$REMOTE/* island, the connectivity check[1] gets expensive for each fetch on systems which lack sufficient RAM to cache objects. To do a no-op fetch on one $REMOTE out of hundreds, hideRefs now allows the no-op fetch to take ~30 seconds instead of ~20 minutes on a noisy, RAM-constrained machine (localhost, so no network latency): git -c fetch.hideRefs=refs \ -c fetch.hideRefs='!refs/remotes/$REMOTE/' \ fetch $REMOTE [1] `git rev-list --objects --stdin --not --all --quiet --alternate-refs' Signed-off-by: Eric Wong <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5510-fetch.sh')
-rwxr-xr-xt/t5510-fetch.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 34a1261520..dc44da9c79 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -1171,6 +1171,15 @@ test_expect_success '--no-show-forced-updates' '
)
'
+for section in fetch transfer
+do
+ test_expect_success "$section.hideRefs affects connectivity check" '
+ GIT_TRACE="$PWD"/trace git -c $section.hideRefs=refs -c \
+ $section.hideRefs="!refs/tags/" fetch &&
+ grep "git rev-list .*--exclude-hidden=fetch" trace
+ '
+done
+
setup_negotiation_tip () {
SERVER="$1"
URL="$2"