Skip to content

Commit 7026eeb

Browse files
mpxBryan Mills
authored and
Bryan Mills
committed
cmd/go: fix buildvcs when using older git versions
Git versions before v2.10.0 do not support --no-show-signature. Using "-c" allows Git to ignore the configuration option if it does not exist. Fixes #51253 Change-Id: I2b1adaca0eb18ae31f2e1119e354ce515b00cfc2 Reviewed-on: https://go-review.googlesource.com/c/go/+/388194 Trust: Dmitri Shuralyov <[email protected]> Run-TryBot: Dmitri Shuralyov <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Bryan Mills <[email protected]>
1 parent 0d33a99 commit 7026eeb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/cmd/go/internal/vcs/vcs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ func gitStatus(vcsGit *Cmd, rootDir string) (Status, error) {
312312
// uncommitted files and skip tagging revision / committime.
313313
var rev string
314314
var commitTime time.Time
315-
out, err = vcsGit.runOutputVerboseOnly(rootDir, "show -s --no-show-signature --format=%H:%ct")
315+
out, err = vcsGit.runOutputVerboseOnly(rootDir, "-c log.showsignature=false show -s --format=%H:%ct")
316316
if err != nil && !uncommitted {
317317
return Status{}, err
318318
} else if err == nil {

src/cmd/go/testdata/script/version_buildvcs_git.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ rm $GOBIN/d$GOEXE
111111
go list -x ./...
112112
stdout -count=3 '^example.com'
113113
stderr -count=1 '^git status'
114-
stderr -count=1 '^git show'
114+
stderr -count=1 '^git -c log.showsignature=false show'
115115

116116
-- $WORK/fakebin/git --
117117
#!/bin/sh

0 commit comments

Comments
 (0)