Use gitRepo as parameter instead of repopath when invoking sign functions (#36162)

Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
Lunny Xiao
2025-12-17 13:55:08 -08:00
committed by GitHub
parent efd5dd4f0b
commit 3e566172f5
10 changed files with 64 additions and 53 deletions
+7 -1
View File
@@ -140,7 +140,13 @@ func PrepareCommitFormOptions(ctx *Context, doer *user_model.User, targetRepo *r
protectionRequireSigned = protectedBranch.RequireSignedCommits
}
willSign, signKey, _, err := asymkey_service.SignCRUDAction(ctx, doer, targetRepo.RepoPath(), refName.String())
targetGitRepo, closer, err := gitrepo.RepositoryFromContextOrOpen(ctx, targetRepo)
if err != nil {
return nil, err
}
defer closer.Close()
willSign, signKey, _, err := asymkey_service.SignCRUDAction(ctx, doer, targetGitRepo, refName.String())
wontSignReason := ""
if asymkey_service.IsErrWontSign(err) {
wontSignReason = string(err.(*asymkey_service.ErrWontSign).Reason)