mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 10:18:38 +00:00
Make Gitea always use its internal config, ignore /etc/gitconfig
(#33076)
In history, Gitea could use the system config `/etc/gitconfig` because some users said that "they might put certNonceSeed in it" Actually, we shouldn't not use it, because it also causes conflicts (there are already some fixes like #28848) To make the system clear, I think it's worth to introduce the breaking change: add `GIT_CONFIG_NOSYSTEM=1` to all git commands. ## ⚠️ BREAKING ⚠️ For most users, nothing need to do. If you have made changes to `/etc/gitconfig` to affect Gitea's behavior, you need to move these config options to Gitea's internal git config file, it is usually in Gitea's `{AppDataPath}/home/.git` directory.
This commit is contained in:
@@ -59,13 +59,7 @@ func InitSettings() {
|
||||
_ = hash.Register("dummy", hash.NewDummyHasher)
|
||||
|
||||
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")
|
||||
setting.InitGiteaEnvVarsForTesting()
|
||||
}
|
||||
|
||||
// TestOptions represents test options
|
||||
|
Reference in New Issue
Block a user