aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-08-08 09:35:47 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-08 09:22:21 -0700
commitc369fc46d079447d216f7ef309ff60abe493cdb6 (patch)
treeadfead0ea34465698ce7e2d8264c81f909ca0d9d /t
parentfb99dded3123cef99aca6caded90251809f300e5 (diff)
downloadgit-c369fc46d079447d216f7ef309ff60abe493cdb6.tar.xz
builtin/submodule: allow "add" to use different ref storage format
Same as with "clone", users may want to add a submodule to a repository with a non-default ref storage format. Wire up a new `--ref-format=` option that works the same as for `git submodule clone`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7424-submodule-mixed-ref-formats.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t7424-submodule-mixed-ref-formats.sh b/t/t7424-submodule-mixed-ref-formats.sh
index d4e184970a..559713b607 100755
--- a/t/t7424-submodule-mixed-ref-formats.sh
+++ b/t/t7424-submodule-mixed-ref-formats.sh
@@ -37,6 +37,17 @@ test_expect_success 'add existing repository with different ref storage format'
)
'
+test_expect_success 'add submodules with different ref storage format' '
+ test_when_finished "rm -rf submodule upstream" &&
+
+ git init submodule &&
+ test_commit -C submodule submodule-initial &&
+ git init upstream &&
+ test_ref_format upstream "$GIT_DEFAULT_REF_FORMAT" &&
+ git -C upstream submodule add --ref-format="$OTHER_FORMAT" "file://$(pwd)/submodule" &&
+ test_ref_format upstream/submodule "$OTHER_FORMAT"
+'
+
test_expect_success 'recursive clone propagates ref storage format' '
test_when_finished "rm -rf submodule upstream downstream" &&