1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-16 07:18:37 +00:00

Refactor env var related code (#33075)

And add more comments
This commit is contained in:
wxiaoguang
2025-01-02 11:36:50 +08:00
committed by GitHub
parent 2852708fdf
commit 4f386e2c5e
5 changed files with 32 additions and 52 deletions

View File

@@ -60,6 +60,12 @@ func InitSettings() {
setting.PasswordHashAlgo, _ = hash.SetDefaultPasswordHashAlgorithm("dummy")
setting.InitGiteaEnvVars()
// Avoid loading the git's system config.
// On macOS, system config sets the osxkeychain credential helper, which will cause tests to freeze with a dialog.
// But we do not set it in production at the moment, because it might be a "breaking" change,
// more details are in "modules/git.commonBaseEnvs".
_ = os.Setenv("GIT_CONFIG_NOSYSTEM", "true")
}
// TestOptions represents test options