From d98fafd2f9b836c91bc707a458e59f869ca1f219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6ran=20Karl?= <3951388+JoeKar@users.noreply.github.com> Date: Thu, 20 Jun 2024 22:32:05 +0200 Subject: [PATCH] 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. --- tools/build-version.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tools/build-version.go b/tools/build-version.go index f583e322..f0f7a8f8 100644 --- a/tools/build-version.go +++ b/tools/build-version.go @@ -38,24 +38,6 @@ func getTag(match ...string) (string, *semver.PRVersion) { } func main() { - tags, err := exec.Command("git", "tag").Output() - if err != nil { - log.Println("git tag:", err) - if e, ok := err.(*exec.ExitError); ok { - log.Print(string(e.Stderr)) - } - } - if len(tags) == 0 { - // no tags found -- fetch them - err = exec.Command("git", "fetch", "--tags").Run() - if err != nil { - log.Println("git fetch --tags:", err) - if e, ok := err.(*exec.ExitError); ok { - log.Print(string(e.Stderr)) - } - } - } - // Find the last vX.X.X Tag and get how many builds we are ahead of it. versionStr, ahead := getTag("--match", "v*") version, err := semver.ParseTolerant(versionStr)