diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2024-03-29 22:55:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-29 21:55:10 +0000 |
commit | b6a3cd4b8dc20ba48d0044a972f6ff0f0de6e49e (patch) | |
tree | b10cc4c44873179343e063392379f522e9c8c99a /modules/git/commit_convert_gogit.go | |
parent | f31a88d3cb64106e75bbe8a3502856db71dbacfc (diff) | |
download | gitea-b6a3cd4b8dc20ba48d0044a972f6ff0f0de6e49e.tar.gz gitea-b6a3cd4b8dc20ba48d0044a972f6ff0f0de6e49e.zip |
Include encoding in signature payload (#30174)
Fixes #30119
Include the encoding in the signature payload.
before

after

Diffstat (limited to 'modules/git/commit_convert_gogit.go')
-rw-r--r-- | modules/git/commit_convert_gogit.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/git/commit_convert_gogit.go b/modules/git/commit_convert_gogit.go index 819ea0d1db..33ef2f4487 100644 --- a/modules/git/commit_convert_gogit.go +++ b/modules/git/commit_convert_gogit.go @@ -47,6 +47,12 @@ func convertPGPSignature(c *object.Commit) *CommitGPGSignature { return nil } + if c.Encoding != "" && c.Encoding != "UTF-8" { + if _, err = fmt.Fprintf(&w, "\nencoding %s\n", c.Encoding); err != nil { + return nil + } + } + if _, err = fmt.Fprintf(&w, "\n\n%s", c.Message); err != nil { return nil } |