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 b79d19e0a7
commit 47717802f8

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