diff options
author | zeripath <art27@cantab.net> | 2020-03-09 07:06:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-09 07:06:38 +0000 |
commit | 3fc4f3670cb748e02d786111d2029ef1e23a9640 (patch) | |
tree | f92527a6e0699eb4092eebd1b4ec6db1462bb0d1 /modules/convert | |
parent | ec4d0cdd56387a49c9c20f238768ea292c6b1222 (diff) | |
download | gitea-3fc4f3670cb748e02d786111d2029ef1e23a9640.tar.gz gitea-3fc4f3670cb748e02d786111d2029ef1e23a9640.zip |
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>
Diffstat (limited to 'modules/convert')
-rw-r--r-- | modules/convert/pull.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/convert/pull.go b/modules/convert/pull.go index ccf64ef3ea..6ff88c4d8a 100644 --- a/modules/convert/pull.go +++ b/modules/convert/pull.go @@ -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 { |