aboutsummaryrefslogtreecommitdiffstats
path: root/models/branches.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-07-25 19:05:51 +0100
committerGitHub <noreply@github.com>2019-07-25 19:05:51 +0100
commit6485962dd53d9704f0a2b438257f722a306beedd (patch)
tree1f75ed04bb54afe5d266a864b8b06426296b3418 /models/branches.go
parent734aa965088fb72330f4ad744c187c614cce3d8b (diff)
downloadgitea-6485962dd53d9704f0a2b438257f722a306beedd.tar.gz
gitea-6485962dd53d9704f0a2b438257f722a306beedd.zip
Fix panic on push at #7611 (#7615)
* Fix panic in #7611 Use pr.IssueID instead of pr.Issue.ID as Issue may not be loaded and is unnecessary * Only fetch the head branch from the remote
Diffstat (limited to 'models/branches.go')
-rw-r--r--models/branches.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/branches.go b/models/branches.go
index c09e72e988..3d3cff84d3 100644
--- a/models/branches.go
+++ b/models/branches.go
@@ -101,7 +101,7 @@ func (protectBranch *ProtectedBranch) HasEnoughApprovals(pr *PullRequest) bool {
// GetGrantedApprovalsCount returns the number of granted approvals for pr. A granted approval must be authored by a user in an approval whitelist.
func (protectBranch *ProtectedBranch) GetGrantedApprovalsCount(pr *PullRequest) int64 {
- reviews, err := GetReviewersByPullID(pr.Issue.ID)
+ reviews, err := GetReviewersByPullID(pr.IssueID)
if err != nil {
log.Error("GetReviewersByPullID: %v", err)
return 0