fix getting version from .git folder (#4430)

This commit is contained in:
Alessandro Ros
2025-04-14 12:31:48 +02:00
committed by GitHub
parent 189c2085db
commit dd9a5caa7b

View File

@@ -82,7 +82,8 @@ func tagFromGit() error {
storer := filesystem.NewStorageWithOptions(storerFs, cache.NewObjectLRUDefault(), filesystem.Options{
AlternatesFS: osfs.New("/", osfs.WithBoundOS()),
})
worktreeFs := osfs.New("../..", osfs.WithBoundOS())
workTreeAbs, _ := filepath.Abs("../../")
worktreeFs := osfs.New(workTreeAbs, osfs.WithBoundOS())
repo, err := git.Open(storer, worktreeFs)
if err != nil {
return fmt.Errorf("failed to open repository: %w", err)