@@ -14,6 +14,7 @@ import (
1414 "path"
1515 "strings"
1616
17+ asymkey_model "code.gitea.io/gitea/models/asymkey"
1718 "code.gitea.io/gitea/models/db"
1819 git_model "code.gitea.io/gitea/models/git"
1920 issues_model "code.gitea.io/gitea/models/issues"
@@ -99,7 +100,7 @@ type CommitFormOptions struct {
99100 UserCanPush bool
100101 RequireSigned bool
101102 WillSign bool
102- SigningKey * git. SigningKey
103+ SigningKey string
103104 WontSignReason string
104105 CanCreatePullRequest bool
105106 CanCreateBasePullRequest bool
@@ -139,7 +140,7 @@ func PrepareCommitFormOptions(ctx *Context, doer *user_model.User, targetRepo *r
139140 protectionRequireSigned = protectedBranch .RequireSignedCommits
140141 }
141142
142- willSign , signKeyID , _ , err := asymkey_service .SignCRUDAction (ctx , targetRepo .RepoPath (), doer , targetRepo .RepoPath (), refName .String ())
143+ willSign , signKey , _ , err := asymkey_service .SignCRUDAction (ctx , targetRepo .RepoPath (), doer , targetRepo .RepoPath (), refName .String ())
143144 wontSignReason := ""
144145 if asymkey_service .IsErrWontSign (err ) {
145146 wontSignReason = string (err .(* asymkey_service.ErrWontSign ).Reason )
@@ -155,14 +156,19 @@ func PrepareCommitFormOptions(ctx *Context, doer *user_model.User, targetRepo *r
155156 canCreateBasePullRequest := targetRepo .BaseRepo != nil && targetRepo .BaseRepo .UnitEnabled (ctx , unit_model .TypePullRequests )
156157 canCreatePullRequest := targetRepo .UnitEnabled (ctx , unit_model .TypePullRequests ) || canCreateBasePullRequest
157158
159+ displayKeyID , displayKeyIDErr := asymkey_model .GetDisplaySigningKey (signKey )
160+ if displayKeyIDErr != nil {
161+ log .Error ("Error whilst getting the display keyID: %s" , displayKeyIDErr .Error ())
162+ }
163+
158164 opts := & CommitFormOptions {
159165 TargetRepo : targetRepo ,
160166 WillSubmitToFork : submitToForkedRepo ,
161167 CanCommitToBranch : canCommitToBranch ,
162168 UserCanPush : canPushWithProtection ,
163169 RequireSigned : protectionRequireSigned ,
164170 WillSign : willSign ,
165- SigningKey : signKeyID ,
171+ SigningKey : displayKeyID ,
166172 WontSignReason : wontSignReason ,
167173
168174 CanCreatePullRequest : canCreatePullRequest ,
0 commit comments