mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-03 10:54:42 +08:00
Fix panic in API pulls when headbranch does not exist (#10676)
* Fix panic in API pulls when headbranch does not exist * refix other reference to plumbing.ErrReferenceNotFound Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
@ -114,7 +114,7 @@ func ToAPIPullRequest(pr *models.PullRequest) *api.PullRequest {
|
||||
if git.IsErrBranchNotExist(err) {
|
||||
headCommitID, err := headGitRepo.GetRefCommitID(apiPullRequest.Head.Ref)
|
||||
if err != nil && !git.IsErrNotExist(err) {
|
||||
log.Error("GetCommit[%s]: %v", headBranch.Name, err)
|
||||
log.Error("GetCommit[%s]: %v", pr.HeadBranch, err)
|
||||
return nil
|
||||
}
|
||||
if err == nil {
|
||||
|
Reference in New Issue
Block a user