summaryrefslogtreecommitdiffstats
path: root/pkg/env/env.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-08-07 22:48:14 +1000
committerGitHub <noreply@github.com>2023-08-07 22:48:14 +1000
commit579791e7bc8261e9ed578f882f4b8b11a486bf78 (patch)
tree7eae43fd38f1888bd01c126c33f78fbc4b445cec /pkg/env/env.go
parentecaf1e900242931ff4098986e0720eca15a8398a (diff)
parent595e28d335c9874eb56f7de61a85586567cd8f8c (diff)
Fix opening lazygit in a bare repo with specified worktree (#2902)v0.40.1
Diffstat (limited to 'pkg/env/env.go')
-rw-r--r--pkg/env/env.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkg/env/env.go b/pkg/env/env.go
index c96bd18bd..1ade5b8c6 100644
--- a/pkg/env/env.go
+++ b/pkg/env/env.go
@@ -14,6 +14,15 @@ func SetGitDirEnv(value string) {
os.Setenv("GIT_DIR", value)
}
-func UnsetGitDirEnv() {
+func GetWorkTreeEnv() string {
+ return os.Getenv("GIT_WORK_TREE")
+}
+
+func SetWorkTreeEnv(value string) {
+ os.Setenv("GIT_WORK_TREE", value)
+}
+
+func UnsetGitLocationEnvVars() {
_ = os.Unsetenv("GIT_DIR")
+ _ = os.Unsetenv("GIT_WORK_TREE")
}