mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-13 01:30:53 +02:00
Validate --path argument when starting lazygit
This commit is contained in:
@ -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")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user