aboutsummaryrefslogtreecommitdiffstats
path: root/revision.c
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-02-12 09:04:26 +0000
committerJunio C Hamano <gitster@pobox.com>2023-02-27 09:27:03 -0800
commitc6ce27ab08d30dd9d626d7a56cb928bc5792eb27 (patch)
treedb78da0e93422555f1e18788c91f2e5aaa64a2ff /revision.c
parentdadc8e6dacb629f46aee39bde90b6f09b73722eb (diff)
downloadgit-c6ce27ab08d30dd9d626d7a56cb928bc5792eb27.tar.gz
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 'revision.c')
-rw-r--r--revision.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/revision.c b/revision.c
index 21f5f572c2..50940699e4 100644
--- a/revision.c
+++ b/revision.c
@@ -1574,7 +1574,8 @@ void exclude_hidden_refs(struct ref_exclusions *exclusions, const char *section)
{
struct exclude_hidden_refs_cb cb;
- if (strcmp(section, "receive") && strcmp(section, "uploadpack"))
+ if (strcmp(section, "fetch") && strcmp(section, "receive") &&
+ strcmp(section, "uploadpack"))
die(_("unsupported section for hidden refs: %s"), section);
if (exclusions->hidden_refs_configured)