mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-22 05:29:44 +02:00
Validate --path argument when starting lazygit
This commit is contained in:
parent
de6d278e57
commit
3232f46a8b
@ -57,6 +57,11 @@ func Start(buildInfo *BuildInfo, integrationTest integrationTypes.IntegrationTes
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if isRepo, err := isDirectoryAGitRepository(absRepoPath); err != nil || !isRepo {
|
||||||
|
log.Fatal(absRepoPath + " is not a valid git repository.")
|
||||||
|
}
|
||||||
|
|
||||||
cliArgs.WorkTree = absRepoPath
|
cliArgs.WorkTree = absRepoPath
|
||||||
cliArgs.GitDir = filepath.Join(absRepoPath, ".git")
|
cliArgs.GitDir = filepath.Join(absRepoPath, ".git")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user