diff options
author | Emily Shaffer <emilyshaffer@google.com> | 2020-02-21 04:10:27 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-02-25 19:00:38 +0100 |
commit | 132f600b060c2db7fd3d450dfadb6779a61c648a (patch) | |
tree | 1d2b33a3a96e98c15def1cb530092dfe94b89540 /t | |
parent | submodule--helper: use C99 named initializer (diff) | |
download | git-132f600b060c2db7fd3d450dfadb6779a61c648a.tar.xz git-132f600b060c2db7fd3d450dfadb6779a61c648a.zip |
clone: pass --single-branch during --recurse-submodules
Previously, performing "git clone --recurse-submodules --single-branch"
resulted in submodules cloning all branches even though the superproject
cloned only one branch. Pipe --single-branch through the submodule
helper framework to make it to 'clone' later on.
Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t5617-clone-submodules-remote.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/t/t5617-clone-submodules-remote.sh b/t/t5617-clone-submodules-remote.sh index 37fcce9c40..1a041df10b 100755 --- a/t/t5617-clone-submodules-remote.sh +++ b/t/t5617-clone-submodules-remote.sh @@ -14,7 +14,8 @@ test_expect_success 'setup' ' cd sub && git init && test_commit subcommit1 && - git tag sub_when_added_to_super + git tag sub_when_added_to_super && + git branch other ) && git submodule add "file://$pwd/sub" sub && git commit -m "add submodule" && @@ -51,4 +52,14 @@ test_expect_success 'check the default is --no-remote-submodules' ' ) ' +test_expect_success 'clone with --single-branch' ' + test_when_finished "rm -rf super_clone" && + git clone --recurse-submodules --single-branch "file://$pwd/." super_clone && + ( + cd super_clone/sub && + git rev-parse --verify origin/master && + test_must_fail git rev-parse --verify origin/other + ) +' + test_done |