mirror of
https://github.com/harness/drone.git
synced 2025-05-12 23:20:10 +08:00
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
This commit is contained in:
parent
8102265475
commit
f90c099e68
@ -94,10 +94,10 @@ func (r *Repo) Commands() []string {
|
|||||||
branch := r.Branch
|
branch := r.Branch
|
||||||
if len(branch) == 0 {
|
if len(branch) == 0 {
|
||||||
branch = "master"
|
branch = "master"
|
||||||
}
|
}r
|
||||||
|
|
||||||
cmds := []string{}
|
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 {
|
switch {
|
||||||
// if a specific commit is provided then we'll
|
// if a specific commit is provided then we'll
|
||||||
|
Loading…
Reference in New Issue
Block a user