1
0
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:
Jesse Duffield 2023-07-17 15:51:50 +10:00
parent 3a7468ecac
commit 27ade502ee

View File

@ -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 != "" {