Skip to content

Commit 5e0c133

Browse files
committed
archive: handle Windows path
1 parent 0a18ab0 commit 5e0c133

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

commit_archive.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package git
66

77
import (
88
"fmt"
9-
"path"
9+
"path/filepath"
1010
"strings"
1111
)
1212

@@ -28,6 +28,6 @@ func (c *Commit) CreateArchive(target string, archiveType ArchiveType) error {
2828
return fmt.Errorf("unknown format: %v", archiveType)
2929
}
3030

31-
_, err := NewCommand("archive", "--prefix="+path.Base(strings.TrimSuffix(c.repo.Path, ".git"))+"/", "--format="+format, "-o", target, c.ID.String()).RunInDir(c.repo.Path)
31+
_, err := NewCommand("archive", "--prefix="+filepath.Base(strings.TrimSuffix(c.repo.Path, ".git"))+"/", "--format="+format, "-o", target, c.ID.String()).RunInDir(c.repo.Path)
3232
return err
3333
}

git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"time"
1111
)
1212

13-
const _VERSION = "0.4.0"
13+
const _VERSION = "0.4.1"
1414

1515
func Version() string {
1616
return _VERSION

0 commit comments

Comments
 (0)