forked from forgejo/forgejo
Before, in #19732, the old home directory is not correct. This PR introduces a new config option for git home: git.HOME_PATH, which is default to %(APP_DATA_PATH)/home And pass env GNUPGHOME to git command, force Gitea to use a stable GNUPGHOME directory
This commit is contained in:
parent
039a60225a
commit
5e5ff77ed7
8 changed files with 64 additions and 28 deletions
|
@ -21,12 +21,12 @@ import (
|
|||
func testRun(m *testing.M) error {
|
||||
_ = log.NewLogger(1000, "console", "console", `{"level":"trace","stacktracelevel":"NONE","stderr":true}`)
|
||||
|
||||
repoRootPath, err := os.MkdirTemp(os.TempDir(), "repos")
|
||||
gitHomePath, err := os.MkdirTemp(os.TempDir(), "git-home")
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to create temp dir: %w", err)
|
||||
}
|
||||
defer util.RemoveAll(repoRootPath)
|
||||
setting.RepoRootPath = repoRootPath
|
||||
defer util.RemoveAll(gitHomePath)
|
||||
setting.Git.HomePath = gitHomePath
|
||||
|
||||
if err = InitOnceWithSync(context.Background()); err != nil {
|
||||
return fmt.Errorf("failed to call Init: %w", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue