diff --git a/modules/setting/testenv.go b/modules/setting/testenv.go index 0e52e73eb20..38bb936197e 100644 --- a/modules/setting/testenv.go +++ b/modules/setting/testenv.go @@ -121,6 +121,8 @@ func SetupGiteaTestEnv() { panic("SetupGiteaTestEnv failed, paths are not initialized") } + SSH.RootPath = AppDataTempDir("ssh").JoinPath() // prevent tests from writing into ~/.ssh + // TODO: some git repo hooks (test fixtures) still use these env variables, need to be refactored in the future _ = os.Setenv("GITEA_ROOT", giteaRoot) _ = os.Setenv("GITEA_CONF", giteaConf) // test fixture git hooks use "$GITEA_ROOT/$GITEA_CONF" in their scripts