Tested manually with "go test -run TestGetSubmodules".
Fixes #14194.
Change-Id: I4f563b2b8a38f3040d7631f74a7908ab65e0860b
Reviewed-on: https://go-review.googlesource.com/19154
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
name: "Git",
cmd: "git",
- createCmd: []string{"clone {repo} {dir}", "-C {dir} submodule update --init --recursive"},
+ createCmd: []string{"clone {repo} {dir}", "-go-internal-cd {dir} submodule update --init --recursive"},
downloadCmd: []string{"pull --ff-only", "submodule update --init --recursive"},
tagCmd: []tagCmd{
args[i] = expand(m, arg)
}
+ if len(args) >= 2 && args[0] == "-go-internal-cd" {
+ if filepath.IsAbs(args[1]) {
+ dir = args[1]
+ } else {
+ dir = filepath.Join(dir, args[1])
+ }
+ args = args[2:]
+ }
+
_, err := exec.LookPath(v.cmd)
if err != nil {
fmt.Fprintf(os.Stderr,