1
0
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:
Unknwon
2016-08-29 23:56:31 -07:00
parent 0a18ab0f2b
commit 5e0c1330d7
2 changed files with 3 additions and 3 deletions

View File

@@ -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
}

2
git.go
View File

@@ -10,7 +10,7 @@ import (
"time"
)
const _VERSION = "0.4.0"
const _VERSION = "0.4.1"
func Version() string {
return _VERSION