From 65a2f6308184e69cd692c78ed5237f816a3e0732 Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Tue, 25 Mar 2025 21:41:38 +0100 Subject: [PATCH] fix getting MediaMTX version with go-gin (#4367) --- internal/core/versiongetter/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/core/versiongetter/main.go b/internal/core/versiongetter/main.go index 80f76d37..9b122584 100644 --- a/internal/core/versiongetter/main.go +++ b/internal/core/versiongetter/main.go @@ -5,6 +5,7 @@ import ( "fmt" "log" "os" + "path/filepath" "strconv" "strings" @@ -76,7 +77,8 @@ func tagFromGit() error { // where .git/objects/info/alternates points to a directory outside of the .git directory. // // To work around this, specify an AlternatesFS that allows access to the entire filesystem. - storerFs := osfs.New("../../.git", osfs.WithBoundOS()) + dotGitAbs, _ := filepath.Abs("../../.git") + storerFs := osfs.New(dotGitAbs, osfs.WithBoundOS()) storer := filesystem.NewStorageWithOptions(storerFs, cache.NewObjectLRUDefault(), filesystem.Options{ AlternatesFS: osfs.New("/", osfs.WithBoundOS()), })