forked from forgejo/forgejo
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:
parent
d501aec427
commit
a291a0eddc
2 changed files with 10 additions and 47 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue