summaryrefslogtreecommitdiffstats
path: root/pkg/app
diff options
context:
space:
mode:
authorLuka Markušić <luka.markusic@microblink.com>2022-09-12 17:18:42 +0200
committerLuka Markušić <luka.markusic@microblink.com>2022-09-12 17:18:42 +0200
commit3232f46a8bbaa5dde12ceea55fabaddff4054172 (patch)
tree43d27cb5074e9490eb18de34896d7f89ff3fcd03 /pkg/app
parentde6d278e572f7f79a56323446306a2962487c024 (diff)
Validate --path argument when starting lazygit
Diffstat (limited to 'pkg/app')
-rw-r--r--pkg/app/entry_point.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/app/entry_point.go b/pkg/app/entry_point.go
index 5a767bb94..b355ebcca 100644
--- a/pkg/app/entry_point.go
+++ b/pkg/app/entry_point.go
@@ -57,6 +57,11 @@ func Start(buildInfo *BuildInfo, integrationTest integrationTypes.IntegrationTes
if err != nil {
log.Fatal(err)
}
+
+ if isRepo, err := isDirectoryAGitRepository(absRepoPath); err != nil || !isRepo {
+ log.Fatal(absRepoPath + " is not a valid git repository.")
+ }
+
cliArgs.WorkTree = absRepoPath
cliArgs.GitDir = filepath.Join(absRepoPath, ".git")
}