summaryrefslogtreecommitdiffstats
path: root/modules/repofiles/verification.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/repofiles/verification.go')
-rw-r--r--modules/repofiles/verification.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/modules/repofiles/verification.go b/modules/repofiles/verification.go
index 9fc084daaf..3889b7993c 100644
--- a/modules/repofiles/verification.go
+++ b/modules/repofiles/verification.go
@@ -18,10 +18,16 @@ func GetPayloadCommitVerification(commit *git.Commit) *structs.PayloadCommitVeri
verification.Signature = commit.Signature.Signature
verification.Payload = commit.Signature.Payload
}
- if verification.Reason != "" {
- verification.Reason = commitVerification.Reason
- } else if verification.Verified {
- verification.Reason = "unsigned"
+ if commitVerification.SigningUser != nil {
+ verification.Signer = &structs.PayloadUser{
+ Name: commitVerification.SigningUser.Name,
+ Email: commitVerification.SigningUser.Email,
+ }
+ }
+ verification.Verified = commitVerification.Verified
+ verification.Reason = commitVerification.Reason
+ if verification.Reason == "" && !verification.Verified {
+ verification.Reason = "gpg.error.not_signed_commit"
}
return verification
}