mirror of
https://github.com/go-gitea/git.git
synced 2026-02-05 15:45:40 +01:00
archive: handle Windows path
This commit is contained in:
@@ -6,7 +6,7 @@ package git
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -28,6 +28,6 @@ func (c *Commit) CreateArchive(target string, archiveType ArchiveType) error {
|
||||
return fmt.Errorf("unknown format: %v", archiveType)
|
||||
}
|
||||
|
||||
_, err := NewCommand("archive", "--prefix="+path.Base(strings.TrimSuffix(c.repo.Path, ".git"))+"/", "--format="+format, "-o", target, c.ID.String()).RunInDir(c.repo.Path)
|
||||
_, err := NewCommand("archive", "--prefix="+filepath.Base(strings.TrimSuffix(c.repo.Path, ".git"))+"/", "--format="+format, "-o", target, c.ID.String()).RunInDir(c.repo.Path)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user