Skip to content

Commit d98fafd

Browse files
committed
tools/build-version.go: Remove the git fetch step
build-version.go shall only provide information and not modify the repository in which it runs.
1 parent f5a9744 commit d98fafd

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

tools/build-version.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,6 @@ func getTag(match ...string) (string, *semver.PRVersion) {
3838
}
3939

4040
func main() {
41-
tags, err := exec.Command("git", "tag").Output()
42-
if err != nil {
43-
log.Println("git tag:", err)
44-
if e, ok := err.(*exec.ExitError); ok {
45-
log.Print(string(e.Stderr))
46-
}
47-
}
48-
if len(tags) == 0 {
49-
// no tags found -- fetch them
50-
err = exec.Command("git", "fetch", "--tags").Run()
51-
if err != nil {
52-
log.Println("git fetch --tags:", err)
53-
if e, ok := err.(*exec.ExitError); ok {
54-
log.Print(string(e.Stderr))
55-
}
56-
}
57-
}
58-
5941
// Find the last vX.X.X Tag and get how many builds we are ahead of it.
6042
versionStr, ahead := getTag("--match", "v*")
6143
version, err := semver.ParseTolerant(versionStr)

0 commit comments

Comments
 (0)