summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan Bazalgette <git@howl.moe>2018-03-04 03:45:01 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2018-03-04 10:45:01 +0800
commitb730498f02e21e290574c2d8448a8b9d4c626c3b (patch)
treec41cca7d552c1ddd445189aed8feeba7f97d6f66
parent78b54b49fa110ed3350c1fa4c46c9ba7cf7ab68c (diff)
downloadgitea-b730498f02e21e290574c2d8448a8b9d4c626c3b.tar.gz
gitea-b730498f02e21e290574c2d8448a8b9d4c626c3b.zip
Don't write to log NoCommitterAccount (#3621)
* Don't write to log NoCommitterAccount It's way too verbose, and the information is also printed to the user already. Fixes #3602. * ignore err only if it's a ErrUserNotExist * Replace with IsErrUserNotExist
-rw-r--r--models/gpg_key.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/models/gpg_key.go b/models/gpg_key.go
index b7d86c8bfe..45da889504 100644
--- a/models/gpg_key.go
+++ b/models/gpg_key.go
@@ -374,7 +374,11 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
//Find Committer account
committer, err := GetUserByEmail(c.Committer.Email) //This find the user by primary email or activated email so commit will not be valid if email is not
if err != nil { //Skipping not user for commiter
- log.Error(3, "NoCommitterAccount: %v", err)
+ // We can expect this to often be an ErrUserNotExist. in the case
+ // it is not, however, it is important to log it.
+ if !IsErrUserNotExist(err) {
+ log.Error(3, "GetUserByEmail: %v", err)
+ }
return &CommitVerification{
Verified: false,
Reason: "gpg.error.no_committer_account",