summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 != "" {