summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTicClick <ya@ticclick.ch>2022-01-06 00:32:20 +0100
committerJesse Duffield <jessedduffield@gmail.com>2022-01-09 14:35:57 +1100
commit4744b39f038d9e197455dc81a55277e1b1fe0586 (patch)
treeb21e415a42592c03107d685c9e37ada969b5ffaf
parent2436ff197a6493d57a689f14e167c64b41ee500a (diff)
work with absolute paths when invoked with --pathv0.32
-rw-r--r--main.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.go b/main.go
index 0b6a97e64..c6c097146 100644
--- a/main.go
+++ b/main.go
@@ -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 != "" {