Skip to content

Commit

Permalink
Fix path for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW committed Jan 24, 2024
1 parent 082e500 commit 47285ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion internal/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ func RootPath(base string) (string, error) {
if fi, err := os.Stat(gitConfig); err == nil && !fi.IsDir() {
return p, nil
}
if p == "/" {
if filepath.Dir(p) == p {
// root directory
break
}
p = filepath.Dir(p)
Expand Down
4 changes: 2 additions & 2 deletions ratio/ratio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func TestPathMatch(t *testing.T) {
if err != nil {
t.Fatal(err)
}
want := "ratio/ratio_test.go"
want := filepath.FromSlash("ratio/ratio_test.go")
ok := false
for _, f := range got.CodeFiles {
if f.Path == want {
Expand All @@ -124,7 +124,7 @@ func TestPathMatch(t *testing.T) {
if err != nil {
t.Fatal(err)
}
want := "ratio/ratio_test.go"
want := filepath.FromSlash("ratio/ratio_test.go")
ok := false
for _, f := range got.CodeFiles {
if f.Path == want {
Expand Down

0 comments on commit 47285ff

Please sign in to comment.