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

Commit

Permalink
Use cross-platform path separator (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethantkoenig authored and appleboy committed Jun 6, 2017
1 parent 544c5b3 commit a709880
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tree_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package git

import (
"os"
"path/filepath"
"sort"
"strconv"
Expand Down Expand Up @@ -215,7 +216,7 @@ func (state *getCommitInfoState) update(path string) error {
return nil
}
var entryPath string
if index := strings.IndexRune(relPath, '/'); index >= 0 {
if index := strings.IndexRune(relPath, os.PathSeparator); index >= 0 {
entryPath = filepath.Join(state.treePath, relPath[:index])
} else {
entryPath = path
Expand Down

0 comments on commit a709880

Please sign in to comment.