Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.

Commit a709880

Browse files
ethantkoenigappleboy
authored andcommitted
Use cross-platform path separator (#59)
1 parent 544c5b3 commit a709880

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tree_entry.go

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

77
import (
8+
"os"
89
"path/filepath"
910
"sort"
1011
"strconv"
@@ -215,7 +216,7 @@ func (state *getCommitInfoState) update(path string) error {
215216
return nil
216217
}
217218
var entryPath string
218-
if index := strings.IndexRune(relPath, '/'); index >= 0 {
219+
if index := strings.IndexRune(relPath, os.PathSeparator); index >= 0 {
219220
entryPath = filepath.Join(state.treePath, relPath[:index])
220221
} else {
221222
entryPath = path

0 commit comments

Comments
 (0)