diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-03-18 00:03:10 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-03-18 00:03:10 +0300 |
commit | 4d87411ffe2432efa8800b9e9d889241dd0f1f07 (patch) | |
tree | 1e558c7301712ced55ffcf1dcd5fccf357a6b287 /t | |
parent | 92c56da09683fa3331668adec073b6769da8f0b7 (diff) | |
parent | c6ce27ab08d30dd9d626d7a56cb928bc5792eb27 (diff) |
Merge branch 'ew/fetch-hiderefs'
A new "fetch.hideRefs" option can be used to exclude specified refs
from "rev-list --objects --stdin --not --all" traversal for
checking object connectivity, most useful when there are many
unrelated histories in a single repository.
* ew/fetch-hiderefs:
fetch: support hideRefs to speed up connectivity checks
Diffstat (limited to 't')
-rwxr-xr-x | t/t5510-fetch.sh | 9 | ||||
-rwxr-xr-x | t/t6018-rev-list-glob.sh | 2 | ||||
-rwxr-xr-x | t/t6021-rev-list-exclude-hidden.sh | 2 |
3 files changed, 11 insertions, 2 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" diff --git a/t/t6018-rev-list-glob.sh b/t/t6018-rev-list-glob.sh index aabf590dda..67d523d405 100755 --- a/t/t6018-rev-list-glob.sh +++ b/t/t6018-rev-list-glob.sh @@ -187,7 +187,7 @@ test_expect_success 'rev-parse --exclude=ref with --remotes=glob' ' compare rev-parse "--exclude=upstream/x --remotes=upstream/*" "upstream/one upstream/two" ' -for section in receive uploadpack +for section in fetch receive uploadpack do test_expect_success "rev-parse --exclude-hidden=$section with --all" ' compare "-c transfer.hideRefs=refs/remotes/ rev-parse" "--branches --tags" "--exclude-hidden=$section --all" diff --git a/t/t6021-rev-list-exclude-hidden.sh b/t/t6021-rev-list-exclude-hidden.sh index 11c50b7c0d..1a9d37e638 100755 --- a/t/t6021-rev-list-exclude-hidden.sh +++ b/t/t6021-rev-list-exclude-hidden.sh @@ -22,7 +22,7 @@ test_expect_success 'invalid section' ' test_cmp expected err ' -for section in receive uploadpack +for section in fetch receive uploadpack do test_expect_success "$section: passed multiple times" ' echo "fatal: --exclude-hidden= passed more than once" >expected && |