use strpbrk(3) to search for characters from a given set
[git/debian.git] / t / t5617-clone-submodules-remote.sh
blob37fcce9c40c98f55f76f01bf38ca575f7c246d09
1 #!/bin/sh
3 test_description='Test cloning repos with submodules using remote-tracking branches'
5 . ./test-lib.sh
7 pwd=$(pwd)
9 test_expect_success 'setup' '
10 git checkout -b master &&
11 test_commit commit1 &&
12 mkdir sub &&
14 cd sub &&
15 git init &&
16 test_commit subcommit1 &&
17 git tag sub_when_added_to_super
18 ) &&
19 git submodule add "file://$pwd/sub" sub &&
20 git commit -m "add submodule" &&
22 cd sub &&
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 &&
31 cd super_clone/sub &&
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 &&
40 cd super_clone/sub &&
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 &&
49 cd super_clone/sub &&
50 git diff --exit-code sub_when_added_to_super
54 test_done