summaryrefslogtreecommitdiffstats
path: root/t/t9210-scalar.sh
diff options
context:
space:
mode:
authorDerrick Stolee <stolee@gmail.com>2024-09-06 22:21:41 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-06 23:13:48 +0200
commitce31b82ca95ba13aba424a1e3d09a292637f6f1d (patch)
treee92748b798dc8a61647d545614e80fabdb6609f7 /t/t9210-scalar.sh
parentThe twelfth batch (diff)
downloadgit-ce31b82ca95ba13aba424a1e3d09a292637f6f1d.tar.xz
git-ce31b82ca95ba13aba424a1e3d09a292637f6f1d.zip
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 in 0dab2468ee5 (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 in 4527db8ff8c (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>
Diffstat (limited to '')
-rwxr-xr-xt/t9210-scalar.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t9210-scalar.sh b/t/t9210-scalar.sh
index a41b4fcc08..e8613990e1 100755
--- a/t/t9210-scalar.sh
+++ b/t/t9210-scalar.sh
@@ -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 &&