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
19 git submodule add "file://$pwd/sub" sub &&
20 git commit -m "add submodule" &&
23 test_commit subcommit2
27 test_expect_success 'clone with --no-remote-submodules' '
28 test_when_finished "rm -rf super_clone" &&
29 git clone --recurse-submodules --no-remote-submodules "file://$pwd/." super_clone &&
32 git diff --exit-code sub_when_added_to_super
36 test_expect_success 'clone with --remote-submodules' '
37 test_when_finished "rm -rf super_clone" &&
38 git clone --recurse-submodules --remote-submodules "file://$pwd/." super_clone &&
41 git diff --exit-code remotes/origin/master
45 test_expect_success 'check the default is --no-remote-submodules' '
46 test_when_finished "rm -rf super_clone" &&
47 git clone --recurse-submodules "file://$pwd/." super_clone &&
50 git diff --exit-code sub_when_added_to_super