From: David Turner Date: Tue, 12 Jan 2016 01:22:16 GMT Subject: [PATCH v2 17/21] clone: use child_process for recursive checkouts Message-ID: <1452561740-8668-18-git-send-email-dturner@twopensource.com> In-Reply-To: <1452561740-8668-1-git-send-email-dturner@twopensource.com> From: Michael Haggerty Signed-off-by: Michael Haggerty --- builtin/clone.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/builtin/clone.c b/builtin/clone.c index caae43e..53c2834 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -95,10 +95,6 @@ static struct option builtin_clone_options[] = { OPT_END() }; -static const char *argv_submodule[] = { - "submodule", "update", "--init", "--recursive", NULL -}; - static const char *get_repo_path_1(struct strbuf *path, int *is_bundle) { static char *suffix[] = { "/.git", "", ".git/.git", ".git" }; @@ -724,8 +720,14 @@ static int checkout(void) err |= run_hook_le(NULL, "post-checkout", sha1_to_hex(null_sha1), sha1_to_hex(sha1), "1", NULL); - if (!err && option_recursive) - err = run_command_v_opt(argv_submodule, RUN_GIT_CMD); + if (!err && option_recursive) { + struct child_process cmd = CHILD_PROCESS_INIT; + + cmd.git_cmd = 1; + argv_array_pushl(&cmd.args, "submodule", "update", + "--init", "--recursive", NULL); + err = run_command(&cmd); + } return err; } -- 2.4.2.749.g730654d-twtrsrc