]> source.dussan.org Git - gitea.git/commitdiff
models: break out of loop (#12386) (#12561)
authorzeripath <art27@cantab.net>
Sat, 22 Aug 2020 15:22:07 +0000 (16:22 +0100)
committerGitHub <noreply@github.com>
Sat, 22 Aug 2020 15:22:07 +0000 (16:22 +0100)
Backport #12386

Co-authored-by: Lars Lehtonen <lars.lehtonen@gmail.com>
models/pull_sign.go

index 91b8defa53ead39b6f8ba3177d538f62cdaab254..ab61232d652c4fa1b409c9ba8a316b3d98c6ab7d 100644 (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 {