Skip to content

Commit 0c0e484

Browse files
committed
cmd/go: remove --first-parent for git tag discovery
This commit fixes an invalid last tag retrieval for go modules by including git tag from merge branches. Fixes golang#31673
1 parent 44343c7 commit 0c0e484

File tree

1 file changed

+1
-1
lines changed
  • src/cmd/go/internal/modfetch/codehost

1 file changed

+1
-1
lines changed

src/cmd/go/internal/modfetch/codehost/git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ func (r *gitRepo) RecentTag(rev, prefix string) (tag string, err error) {
650650
// result is definitive.
651651
describe := func() (definitive bool) {
652652
var out []byte
653-
out, err = Run(r.dir, "git", "describe", "--first-parent", "--always", "--abbrev=0", "--match", prefix+"v[0-9]*.[0-9]*.[0-9]*", "--tags", rev)
653+
out, err = Run(r.dir, "git", "describe", "--always", "--abbrev=0", "--match", prefix+"v[0-9]*.[0-9]*.[0-9]*", "--tags", rev)
654654
if err != nil {
655655
return true // Because we use "--always", describe should never fail.
656656
}

0 commit comments

Comments
 (0)