summaryrefslogtreecommitdiff
path: root/builtin/clone.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-07-06 13:38:13 -0700
committerJunio C Hamano <gitster@pobox.com>2016-07-06 13:38:13 -0700
commit9f1027d18a23e7c2ae60d3fb0a943e7b3342c532 (patch)
tree0a21a9f5e2868c06264cf2f979783a814dc0f00b /builtin/clone.c
parented0f7bdec93478e280c9faa2a8ffb13a183cda09 (diff)
parent18a74a092bff41f1ffe10bd2463d3eed9a04435d (diff)
downloadgit-9f1027d18a23e7c2ae60d3fb0a943e7b3342c532.tar.gz
Merge branch 'sb/clone-shallow-passthru'
Fix an unintended regression in v2.9 that breaks "clone --depth" that recurses down to submodules by forcing the submodules to also be cloned shallowly, which many server instances that host upstream of the submodules are not prepared for. * sb/clone-shallow-passthru: clone: do not let --depth imply --shallow-submodules
Diffstat (limited to 'builtin/clone.c')
-rw-r--r--builtin/clone.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 70d8213472..31ea247e3f 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -40,7 +40,7 @@ static const char * const builtin_clone_usage[] = {
static int option_no_checkout, option_bare, option_mirror, option_single_branch = -1;
static int option_local = -1, option_no_hardlinks, option_shared, option_recursive;
-static int option_shallow_submodules = -1;
+static int option_shallow_submodules;
static char *option_template, *option_depth;
static char *option_origin = NULL;
static char *option_branch = NULL;
@@ -738,8 +738,7 @@ static int checkout(void)
struct argv_array args = ARGV_ARRAY_INIT;
argv_array_pushl(&args, "submodule", "update", "--init", "--recursive", NULL);
- if (option_shallow_submodules == 1
- || (option_shallow_submodules == -1 && option_depth))
+ if (option_shallow_submodules == 1)
argv_array_push(&args, "--depth=1");
if (max_jobs != -1)