Skip to content

Commit

Permalink
cmd/go: remove --first-parent for git tag discovery
Browse files Browse the repository at this point in the history
This commit fixes an invalid last tag retrieval for go modules by
including git tag from merge branches.

Fixes golang#31673
  • Loading branch information
saschagrunert committed Apr 25, 2019
1 parent 44343c7 commit 0906058
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/go/internal/modfetch/codehost/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ func (r *gitRepo) RecentTag(rev, prefix string) (tag string, err error) {
// result is definitive.
describe := func() (definitive bool) {
var out []byte
out, err = Run(r.dir, "git", "describe", "--first-parent", "--always", "--abbrev=0", "--match", prefix+"v[0-9]*.[0-9]*.[0-9]*", "--tags", rev)
out, err = Run(r.dir, "git", "describe", "--always", "--abbrev=0", "--match", prefix+"v[0-9]*.[0-9]*.[0-9]*", "--tags", rev)
if err != nil {
return true // Because we use "--always", describe should never fail.
}
Expand Down

0 comments on commit 0906058

Please sign in to comment.