mirror of
https://github.com/git/git.git
synced 2026-04-10 17:00:09 +02:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
fb99dded31
commit
c369fc46d0
@@ -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" &&
|
||||
|
||||
|
||||
Reference in New Issue
Block a user