models: break out of loop (#12386) (#12561)

Backport #12386

Co-authored-by: Lars Lehtonen <lars.lehtonen@gmail.com>
This commit is contained in:
zeripath 2020-08-22 16:22:07 +01:00 committed by GitHub
parent ee5e5a5093
commit 1f85815a3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -27,12 +27,13 @@ func (pr *PullRequest) SignMerge(u *User, tmpBasePath, baseCommit, headCommit st
var gitRepo *git.Repository
var err error
Loop:
for _, rule := range rules {
switch rule {
case never:
return false, "", &ErrWontSign{never}
case always:
break
break Loop
case pubkey:
keys, err := ListGPGKeys(u.ID, ListOptions{})
if err != nil {