diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-05 18:26:51 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-05 18:26:51 +0800 |
commit | 4f4f6a25be2625b4bb2cb10e3520f52c4a35c243 (patch) | |
tree | 5458da1ee5efa5e46e831c34c1f39ebc67fb71b0 /lmtp_handle_patch.go | |
parent | Remove renderReadmeAtTree (diff) | |
download | forge-4f4f6a25be2625b4bb2cb10e3520f52c4a35c243.tar.gz forge-4f4f6a25be2625b4bb2cb10e3520f52c4a35c243.tar.zst forge-4f4f6a25be2625b4bb2cb10e3520f52c4a35c243.zip |
Separate code/README rendering and unsafe to their own packages
Diffstat (limited to 'lmtp_handle_patch.go')
-rw-r--r-- | lmtp_handle_patch.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lmtp_handle_patch.go b/lmtp_handle_patch.go index 6bcb272..45d146a 100644 --- a/lmtp_handle_patch.go +++ b/lmtp_handle_patch.go @@ -16,6 +16,7 @@ import ( "github.com/bluekeyes/go-gitdiff/gitdiff" "github.com/go-git/go-git/v5" + "go.lindenii.runxiyu.org/forge/misc" ) func lmtpHandlePatch(session *lmtpSession, groupPath []string, repoName string, mbox io.Reader) (err error) { @@ -63,7 +64,7 @@ func lmtpHandlePatch(session *lmtpSession, groupPath []string, repoName string, return fmt.Errorf("failed to get contents: %w", err) } - sourceBuf := bytes.NewReader(stringToBytes(sourceString)) + sourceBuf := bytes.NewReader(misc.StringToBytes(sourceString)) var patchedBuf bytes.Buffer if err := gitdiff.Apply(&patchedBuf, sourceBuf, diffFile); err != nil { return fmt.Errorf("failed to apply patch: %w", err) |