From 4f386e2c5e39b860424faf4cbc02c16f641f956e Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 2 Jan 2025 11:36:50 +0800 Subject: Refactor env var related code (#33075) And add more comments --- models/unittest/testdb.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'models/unittest') diff --git a/models/unittest/testdb.go b/models/unittest/testdb.go index 43d084845c..7bf9829b6f 100644 --- a/models/unittest/testdb.go +++ b/models/unittest/testdb.go @@ -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 -- cgit v1.2.3