@@ -14,6 +14,7 @@ import (
14
14
"path"
15
15
"strings"
16
16
17
+ asymkey_model "code.gitea.io/gitea/models/asymkey"
17
18
"code.gitea.io/gitea/models/db"
18
19
git_model "code.gitea.io/gitea/models/git"
19
20
issues_model "code.gitea.io/gitea/models/issues"
@@ -99,7 +100,7 @@ type CommitFormOptions struct {
99
100
UserCanPush bool
100
101
RequireSigned bool
101
102
WillSign bool
102
- SigningKey * git. SigningKey
103
+ SigningKeyFormDisplay string
103
104
WontSignReason string
104
105
CanCreatePullRequest bool
105
106
CanCreateBasePullRequest bool
@@ -139,7 +140,7 @@ func PrepareCommitFormOptions(ctx *Context, doer *user_model.User, targetRepo *r
139
140
protectionRequireSigned = protectedBranch .RequireSignedCommits
140
141
}
141
142
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 ())
143
144
wontSignReason := ""
144
145
if asymkey_service .IsErrWontSign (err ) {
145
146
wontSignReason = string (err .(* asymkey_service.ErrWontSign ).Reason )
@@ -156,14 +157,14 @@ func PrepareCommitFormOptions(ctx *Context, doer *user_model.User, targetRepo *r
156
157
canCreatePullRequest := targetRepo .UnitEnabled (ctx , unit_model .TypePullRequests ) || canCreateBasePullRequest
157
158
158
159
opts := & CommitFormOptions {
159
- TargetRepo : targetRepo ,
160
- WillSubmitToFork : submitToForkedRepo ,
161
- CanCommitToBranch : canCommitToBranch ,
162
- UserCanPush : canPushWithProtection ,
163
- RequireSigned : protectionRequireSigned ,
164
- WillSign : willSign ,
165
- SigningKey : signKeyID ,
166
- WontSignReason : wontSignReason ,
160
+ TargetRepo : targetRepo ,
161
+ WillSubmitToFork : submitToForkedRepo ,
162
+ CanCommitToBranch : canCommitToBranch ,
163
+ UserCanPush : canPushWithProtection ,
164
+ RequireSigned : protectionRequireSigned ,
165
+ WillSign : willSign ,
166
+ SigningKeyFormDisplay : asymkey_model . GetDisplaySigningKey ( signKey ) ,
167
+ WontSignReason : wontSignReason ,
167
168
168
169
CanCreatePullRequest : canCreatePullRequest ,
169
170
CanCreateBasePullRequest : canCreateBasePullRequest ,
0 commit comments