move git dir env stuff into a centralised package
This commit is contained in:
24
pkg/env/env.go
vendored
Normal file
24
pkg/env/env.go
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package env
|
||||
|
||||
import "os"
|
||||
|
||||
func GetGitDirEnv() string {
|
||||
return os.Getenv("GIT_DIR")
|
||||
}
|
||||
|
||||
func GetGitWorkTreeEnv() string {
|
||||
return os.Getenv("GIT_WORK_TREE")
|
||||
}
|
||||
|
||||
func SetGitDirEnv(value string) {
|
||||
os.Setenv("GIT_DIR", value)
|
||||
}
|
||||
|
||||
func SetGitWorkTreeEnv(value string) {
|
||||
os.Setenv("GIT_WORK_TREE", value)
|
||||
}
|
||||
|
||||
func UnsetGitDirEnvs() {
|
||||
_ = os.Unsetenv("GIT_DIR")
|
||||
_ = os.Unsetenv("GIT_WORK_TREE")
|
||||
}
|
||||
Reference in New Issue
Block a user