scalar: add --no-tags option to 'scalar clone'
Some large repositories use tags to track a huge list of release versions. While this choice is costly on the ref advertisement, it is further wasteful for clients who do not need those tags. Allow clients to optionally skip the tag advertisement. This behavior is similar to that of 'git clone --no-tags' implemented in0dab2468ee
(clone: add a --no-tags option to clone without tags, 2017-04-26), including the modification of the remote.origin.tagOpt config value to include "--no-tags". One thing that is opposite of the 'git clone' implementation is that this allows '--tags' as an assumed option, which can be naturally negated with '--no-tags'. The clone command does not accept '--tags' but allows "--no-no-tags" as the negation of its '--no-tags' option. While testing this option, combine the test with the previously untested '--no-src' option introduced in4527db8ff8
(scalar: add --[no-]src option, 2023-08-28). Signed-off-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
2e7b89e038
commit
ce31b82ca9
@ -169,6 +169,24 @@ test_expect_success 'scalar clone' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'scalar clone --no-... opts' '
|
||||
# Note: redirect stderr always to avoid having a verbose test
|
||||
# run result in a difference in the --[no-]progress option.
|
||||
GIT_TRACE2_EVENT="$(pwd)/no-opt-trace" scalar clone \
|
||||
--no-tags --no-src \
|
||||
"file://$(pwd)" no-opts --single-branch 2>/dev/null &&
|
||||
|
||||
test_subcommand git fetch --quiet --no-progress \
|
||||
origin --no-tags <no-opt-trace &&
|
||||
(
|
||||
cd no-opts &&
|
||||
|
||||
test_cmp_config --no-tags remote.origin.tagopt &&
|
||||
git for-each-ref --format="%(refname)" refs/tags/ >tags &&
|
||||
test_line_count = 0 tags
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'scalar reconfigure' '
|
||||
git init one/src &&
|
||||
scalar register one &&
|
||||
|
Reference in New Issue
Block a user