3 test_description
='Test cloning repos with submodules using remote-tracking branches'
9 test_expect_success
'setup' '
10 git checkout -b master &&
11 test_commit commit1 &&
16 test_commit subcommit1 &&
17 git tag sub_when_added_to_super &&
20 git submodule add "file://$pwd/sub" sub &&
21 git commit -m "add submodule" &&
24 test_commit subcommit2
28 test_expect_success
'clone with --no-remote-submodules' '
29 test_when_finished "rm -rf super_clone" &&
30 git clone --recurse-submodules --no-remote-submodules "file://$pwd/." super_clone &&
33 git diff --exit-code sub_when_added_to_super
37 test_expect_success
'clone with --remote-submodules' '
38 test_when_finished "rm -rf super_clone" &&
39 git clone --recurse-submodules --remote-submodules "file://$pwd/." super_clone &&
42 git diff --exit-code remotes/origin/master
46 test_expect_success
'check the default is --no-remote-submodules' '
47 test_when_finished "rm -rf super_clone" &&
48 git clone --recurse-submodules "file://$pwd/." super_clone &&
51 git diff --exit-code sub_when_added_to_super
55 test_expect_success
'clone with --single-branch' '
56 test_when_finished "rm -rf super_clone" &&
57 git clone --recurse-submodules --single-branch "file://$pwd/." super_clone &&
60 git rev-parse --verify origin/master &&
61 test_must_fail git rev-parse --verify origin/other