]> Cypherpunks repositories - gostls13.git/commit
cmd/go: make vcstest repo scripts compatible with old Git versions
authorBryan C. Mills <bcmills@google.com>
Tue, 25 Oct 2022 14:28:50 +0000 (10:28 -0400)
committerGopher Robot <gobot@golang.org>
Tue, 25 Oct 2022 15:36:24 +0000 (15:36 +0000)
commit2d63305b8446c69d79730ff556385cabe09f54ec
treecd06d58cc804b446f6dfb67130456af95ce8e152
parentf9bd1d0f113db5a92e59592f0108dad45a9308ad
cmd/go: make vcstest repo scripts compatible with old Git versions

The scripts added in CL 421455 passed on the TryBots, but failed on a
subset of the builders that have older 'git' binaries installed.

Notably, the older versions of git do not support:
- 'git branch -m' before the current branch has a commit
- 'init.defaultBranch' in the '.gitconfig' file, and
- 'git branch -c'.

We address those by, respectively:
- waiting to run 'git branch -m' until after the first commit
- always running 'git branch -m' explicitly to set the branch name, and
- using 'git checkout' instead of 'git branch -c' to set branch parents.

Updates #27494.

Change-Id: I42f012f5add8f31e41d077d752d8268aacbce8a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/445355
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
24 files changed:
src/cmd/go/testdata/vcstest/git/commit-after-tag.txt
src/cmd/go/testdata/vcstest/git/empty-v2-without-v1.txt
src/cmd/go/testdata/vcstest/git/emptytest.txt
src/cmd/go/testdata/vcstest/git/gitrepo1.txt
src/cmd/go/testdata/vcstest/git/hello.txt
src/cmd/go/testdata/vcstest/git/insecurerepo.txt
src/cmd/go/testdata/vcstest/git/mainonly.txt
src/cmd/go/testdata/vcstest/git/modlegacy1-new.txt
src/cmd/go/testdata/vcstest/git/modlegacy1-old.txt
src/cmd/go/testdata/vcstest/git/no-tags.txt
src/cmd/go/testdata/vcstest/git/odd-tags.txt
src/cmd/go/testdata/vcstest/git/prefixtagtests.txt
src/cmd/go/testdata/vcstest/git/querytest.txt
src/cmd/go/testdata/vcstest/git/retract-pseudo.txt
src/cmd/go/testdata/vcstest/git/semver-branch.txt
src/cmd/go/testdata/vcstest/git/tagtests.txt
src/cmd/go/testdata/vcstest/git/v2repo.txt
src/cmd/go/testdata/vcstest/git/v2sub.txt
src/cmd/go/testdata/vcstest/git/v3pkg.txt
src/cmd/go/testdata/vcstest/git/vgotest1.txt
src/cmd/go/testdata/vcstest/hg/hgrepo1.txt
src/cmd/go/testdata/vcstest/hg/vgotest1.txt
src/cmd/go/testdata/vcstest/svn/test1-svn-git.txt
src/cmd/go/testdata/vcstest/svn/test2-svn-git.txt