From f90c099e684789098b29811022ce027e2cf7aa37 Mon Sep 17 00:00:00 2001 From: Janez Troha Date: Tue, 11 Feb 2014 10:52:39 +0100 Subject: [PATCH 1/2] Add: get git submodules in one step --recursive --recurse-submodules After the clone is created, initialize all submodules within, using their default settings. This is equivalent to running git submodule update --init --recursive immediately after the clone is finished. This option is ignored if the cloned repository does not have a worktree/checkout (i.e. if any of --no-checkout/-n, --bare, or --mirror is given) from http://git-scm.com/docs/git-clone --- pkg/build/repo/repo.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/build/repo/repo.go b/pkg/build/repo/repo.go index 581be9688..7429d8fc6 100644 --- a/pkg/build/repo/repo.go +++ b/pkg/build/repo/repo.go @@ -94,10 +94,10 @@ func (r *Repo) Commands() []string { branch := r.Branch if len(branch) == 0 { branch = "master" - } + }r cmds := []string{} - cmds = append(cmds, fmt.Sprintf("git clone --branch=%s %s %s", branch, r.Path, r.Dir)) + cmds = append(cmds, fmt.Sprintf("git clone --recursive --branch=%s %s %s", branch, r.Path, r.Dir)) switch { // if a specific commit is provided then we'll From c4a040c933016ab53e623b5f56fab6a6a9e2ec82 Mon Sep 17 00:00:00 2001 From: Janez Troha Date: Tue, 11 Feb 2014 20:18:19 +0100 Subject: [PATCH 2/2] Fix: remove mysterious r :) --- pkg/build/repo/repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/build/repo/repo.go b/pkg/build/repo/repo.go index 7429d8fc6..bd55d2b7c 100644 --- a/pkg/build/repo/repo.go +++ b/pkg/build/repo/repo.go @@ -94,7 +94,7 @@ func (r *Repo) Commands() []string { branch := r.Branch if len(branch) == 0 { branch = "master" - }r + } cmds := []string{} cmds = append(cmds, fmt.Sprintf("git clone --recursive --branch=%s %s %s", branch, r.Path, r.Dir))