3 test_description='test protocol whitelisting with submodules'
5 . "$TEST_DIRECTORY"/lib-proto-disable.sh
10 test_expect_success 'setup repository with submodules' '
12 git init remote/repo.git &&
13 (cd remote/repo.git && test_commit one) &&
14 # submodule-add should probably trust what we feed it on the cmdline,
15 # but its implementation is overly conservative.
16 GIT_ALLOW_PROTOCOL=ssh git submodule add remote:repo.git ssh-module &&
17 GIT_ALLOW_PROTOCOL=ext git submodule add "ext::fake-remote %S repo.git" ext-module &&
18 git commit -m "add submodules"
21 test_expect_success 'clone with recurse-submodules fails' '
22 test_must_fail git clone --recurse-submodules . dst
25 test_expect_success 'setup individual updates' '
28 git -C dst submodule init
31 test_expect_success 'update of ssh allowed' '
32 git -C dst submodule update ssh-module
35 test_expect_success 'update of ext not allowed' '
36 test_must_fail git -C dst submodule update ext-module
39 test_expect_success 'user can override whitelist' '
40 GIT_ALLOW_PROTOCOL=ext git -C dst submodule update ext-module