Skip to content

Commit

Permalink
work with absolute paths when invoked with --path
Browse files Browse the repository at this point in the history
  • Loading branch information
TicClick authored and jesseduffield committed Jan 9, 2022
1 parent 2436ff1 commit 4744b39
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ func main() {
log.Fatal("--path option is incompatible with the --work-tree and --git-dir options")
}

workTree = repoPath
gitDir = filepath.Join(repoPath, ".git")
absRepoPath, err := filepath.Abs(repoPath)
if err != nil {
log.Fatal(err)
}
workTree = absRepoPath
gitDir = filepath.Join(absRepoPath, ".git")
}

if customConfig != "" {
Expand Down

0 comments on commit 4744b39

Please sign in to comment.