unset XDG_HOME_CONFIG as gitea manages configuration locations (#33067)

unset XDG_CONFIG_HOME early to enable gitea to manage git configuration.
simple error checking to satisfy the linting. Closes #33039

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
JonRB 2025-01-01 22:37:35 +00:00 committed by GitHub
parent c1167709ed
commit 233b7959e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 0 deletions

View file

@ -166,3 +166,8 @@ func EnvironmentToConfig(cfg ConfigProvider, envs []string) (changed bool) {
}
return changed
}
// InitGiteaEnvVars initilises the environment for gitea
func InitGiteaEnvVars() {
_ = os.Unsetenv("XDG_CONFIG_HOME") // unset if set as HOME is managed by gitea
}