diff options
author | TicClick <ya@ticclick.ch> | 2022-01-06 00:32:20 +0100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-09 14:35:57 +1100 |
commit | 4744b39f038d9e197455dc81a55277e1b1fe0586 (patch) | |
tree | b21e415a42592c03107d685c9e37ada969b5ffaf | |
parent | 2436ff197a6493d57a689f14e167c64b41ee500a (diff) |
work with absolute paths when invoked with --pathv0.32
-rw-r--r-- | main.go | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 != "" { |