mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-12-04 10:34:55 +02:00
Change directory to worktree if given as an argument
Previously we used an env var for this and it's not clear to me how that worked but with this PR current directory = worktree directory
This commit is contained in:
parent
3a7468ecac
commit
27ade502ee
@ -76,7 +76,10 @@ func Start(buildInfo *BuildInfo, integrationTest integrationTypes.IntegrationTes
|
||||
}
|
||||
|
||||
if cliArgs.WorkTree != "" {
|
||||
env.SetGitWorkTreeEnv(cliArgs.WorkTree)
|
||||
err := os.Chdir(cliArgs.WorkTree)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to change directory to %s: %v", cliArgs.WorkTree, err)
|
||||
}
|
||||
}
|
||||
|
||||
if cliArgs.GitDir != "" {
|
||||
|
Loading…
Reference in New Issue
Block a user