mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 18:17:19 +00:00
Prevent deadlock in pull_service.GetDiverging(pr) (#10905)
* Switch to use a temporary repository instead of adding remotes to the base gitea repository to prevent deadlocking the base gitea repository. * Add documentation on how to use func **createTemporaryRepo**
This commit is contained in:
@ -16,6 +16,8 @@ import (
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
)
|
||||
|
||||
// createTemporaryRepo creates a temporary repo with "base" for pr.BaseBranch and "tracking" for pr.HeadBranch
|
||||
// it also create a second base branch called "original_base"
|
||||
func createTemporaryRepo(pr *models.PullRequest) (string, error) {
|
||||
if err := pr.LoadHeadRepo(); err != nil {
|
||||
log.Error("LoadHeadRepo: %v", err)
|
||||
|
Reference in New Issue
Block a user