1
0
Fork 0
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:
6543 2020-04-01 21:03:08 +02:00 committed by GitHub
parent d501aec427
commit a291a0eddc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 47 deletions

View file

@ -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)