Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmily Shaffer <emilyshaffer@google.com>2020-02-21 06:10:27 +0300
committerJunio C Hamano <gitster@pobox.com>2020-02-25 21:00:38 +0300
commit132f600b060c2db7fd3d450dfadb6779a61c648a (patch)
tree1d2b33a3a96e98c15def1cb530092dfe94b89540 /builtin/clone.c
parent47319576f112b60ecd85930d162cd7656132fd0d (diff)
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 'builtin/clone.c')
-rw-r--r--builtin/clone.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 0fc89ae2b9c..9a02ac5b0b2 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -832,6 +832,11 @@ static int checkout(int submodule_progress)
argv_array_push(&args, "--no-fetch");
}
+ if (option_single_branch >= 0)
+ argv_array_push(&args, option_single_branch ?
+ "--single-branch" :
+ "--no-single-branch");
+
err = run_command_v_opt(args.argv, RUN_GIT_CMD);
argv_array_clear(&args);
}