diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2025-01-02 11:36:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-02 11:36:50 +0800 |
commit | 4f386e2c5e39b860424faf4cbc02c16f641f956e (patch) | |
tree | e0dea226639f797db9c0e5d055aef8dad15e1315 /models/unittest | |
parent | 2852708fdf52a784182786cc2969fe5cb44400f9 (diff) | |
download | gitea-4f386e2c5e39b860424faf4cbc02c16f641f956e.tar.gz gitea-4f386e2c5e39b860424faf4cbc02c16f641f956e.zip |
Refactor env var related code (#33075)
And add more comments
Diffstat (limited to 'models/unittest')
-rw-r--r-- | models/unittest/testdb.go | 6 |
1 files changed, 6 insertions, 0 deletions
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 |