move git dir env stuff into a centralised package

This commit is contained in:
Jesse Duffield 2020-09-27 16:17:26 +10:00
parent e873816160
commit 75598ea2a1
6 changed files with 49 additions and 19 deletions

View file

@ -11,6 +11,7 @@ import (
"github.com/integrii/flaggy"
"github.com/jesseduffield/lazygit/pkg/app"
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/env"
)
var (
@ -63,11 +64,11 @@ func main() {
}
if workTree != "" {
os.Setenv("GIT_WORK_TREE", workTree)
env.SetGitWorkTreeEnv(workTree)
}
if gitDir != "" {
os.Setenv("GIT_DIR", gitDir)
env.SetGitDirEnv(gitDir)
}
if versionFlag {