3 test_description
='test protocol filtering with submodules'
5 TEST_PASSES_SANITIZE_LEAK
=true
7 .
"$TEST_DIRECTORY"/lib-proto-disable.sh
12 test_expect_success
'setup repository with submodules' '
14 git init remote/repo.git &&
15 (cd remote/repo.git && test_commit one) &&
16 # submodule-add should probably trust what we feed it on the cmdline,
17 # but its implementation is overly conservative.
18 GIT_ALLOW_PROTOCOL=ssh git submodule add remote:repo.git ssh-module &&
19 GIT_ALLOW_PROTOCOL=ext git submodule add "ext::fake-remote %S repo.git" ext-module &&
20 git commit -m "add submodules"
23 test_expect_success
'clone with recurse-submodules fails' '
24 test_must_fail git clone --recurse-submodules . dst
27 test_expect_success
'setup individual updates' '
30 git -C dst submodule init
33 test_expect_success
'update of ssh allowed' '
34 git -C dst submodule update ssh-module
37 test_expect_success
'update of ext not allowed' '
38 test_must_fail git -C dst submodule update ext-module
41 test_expect_success
'user can filter protocols with GIT_ALLOW_PROTOCOL' '
42 GIT_ALLOW_PROTOCOL=ext git -C dst submodule update ext-module