fix getting MediaMTX version with go-gin (#4367)

This commit is contained in:
Alessandro Ros 2025-03-25 21:41:38 +01:00 committed by GitHub
parent f3af2e78d8
commit 65a2f63081
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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()),
})