From 132f600b060c2db7fd3d450dfadb6779a61c648a Mon Sep 17 00:00:00 2001 From: Emily Shaffer Date: Thu, 20 Feb 2020 19:10:27 -0800 Subject: 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 Acked-by: Jeff King Signed-off-by: Junio C Hamano --- builtin/clone.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'builtin/clone.c') 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); } -- cgit v1.2.3