fix wrong -dirty prefix in version (#3869)

This commit is contained in:
Alessandro Ros 2024-10-12 22:24:40 +02:00 committed by GitHub
parent f231837591
commit 6188ee1886
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -76,11 +76,12 @@ 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.
fs := osfs.New("../../.git", osfs.WithBoundOS())
storer := filesystem.NewStorageWithOptions(fs, cache.NewObjectLRUDefault(), filesystem.Options{
storerFs := osfs.New("../../.git", osfs.WithBoundOS())
storer := filesystem.NewStorageWithOptions(storerFs, cache.NewObjectLRUDefault(), filesystem.Options{
AlternatesFS: osfs.New("/", osfs.WithBoundOS()),
})
repo, err := git.Open(storer, fs)
worktreeFs := osfs.New("../..", osfs.WithBoundOS())
repo, err := git.Open(storer, worktreeFs)
if err != nil {
return fmt.Errorf("failed to open repository: %w", err)
}