Skip to content

Commit

Permalink
traverse: fix parent
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Sep 3, 2023
1 parent 5542e00 commit abe6caa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions pkg/traverse/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ func GitWorkTree(tc Context) (string, error) {
return filepath.ToSlash(dir), nil
}

gitDir, err := GitDir(tc)
return filepath.Dir(gitDir), err
return GitDir(tc)
}
2 changes: 1 addition & 1 deletion pkg/traverse/traverse.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func Parent(names ...string) func(tc Context) (string, error) {

for _, name := range names {
if dir, err := traverse(wd, name); err == nil {
return dir, nil
return filepath.Dir(dir), nil
}
}
formattedNames := fmt.Sprintf("%#v", names)
Expand Down

0 comments on commit abe6caa

Please sign in to comment.