mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-01-10 15:42:16 +01:00
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> (cherry picked from commit 233b7959e0518c47ef83c6a80c617546983433eb)
This commit is contained in:
parent
e7bc13a0be
commit
6208d5f5c2
3 changed files with 7 additions and 0 deletions
|
@ -206,6 +206,7 @@ func innerNewMainApp(version, versionExtra string, subCmdsStandaloneArgs, subCmd
|
|||
app.Commands = append(app.Commands, subCmdWithConfig...)
|
||||
app.Commands = append(app.Commands, subCmdStandalone...)
|
||||
|
||||
setting.InitGiteaEnvVars()
|
||||
return app
|
||||
}
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@ func InitSettings() {
|
|||
_ = hash.Register("dummy", hash.NewDummyHasher)
|
||||
|
||||
setting.PasswordHashAlgo, _ = hash.SetDefaultPasswordHashAlgorithm("dummy")
|
||||
setting.InitGiteaEnvVars()
|
||||
}
|
||||
|
||||
// TestOptions represents test options
|
||||
|
|
|
@ -168,3 +168,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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue