aboutsummaryrefslogtreecommitdiff
path: root/lmtp_handle_patch.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-05 20:26:57 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-05 20:26:57 +0800
commit20b4fe0c59357a433042732d46e38da9c3d14c3b (patch)
tree537d7d450701a839802b1d57a82bd07324dcba90 /lmtp_handle_patch.go
parentmisc: Move utils.go's string function to misc (diff)
downloadforge-20b4fe0c59357a433042732d46e38da9c3d14c3b.tar.gz
forge-20b4fe0c59357a433042732d46e38da9c3d14c3b.tar.zst
forge-20b4fe0c59357a433042732d46e38da9c3d14c3b.zip
database shall no longer be a global variable
Diffstat (limited to '')
-rw-r--r--lmtp_handle_patch.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/lmtp_handle_patch.go b/lmtp_handle_patch.go
index 45d146a..ab846aa 100644
--- a/lmtp_handle_patch.go
+++ b/lmtp_handle_patch.go
@@ -19,7 +19,7 @@ import (
"go.lindenii.runxiyu.org/forge/misc"
)
-func lmtpHandlePatch(session *lmtpSession, groupPath []string, repoName string, mbox io.Reader) (err error) {
+func (s *server) lmtpHandlePatch(session *lmtpSession, groupPath []string, repoName string, mbox io.Reader) (err error) {
var diffFiles []*gitdiff.File
var preamble string
if diffFiles, preamble, err = gitdiff.Parse(mbox); err != nil {
@@ -33,7 +33,7 @@ func lmtpHandlePatch(session *lmtpSession, groupPath []string, repoName string,
var repo *git.Repository
var fsPath string
- repo, _, _, fsPath, err = openRepo(session.ctx, groupPath, repoName)
+ repo, _, _, fsPath, err = s.openRepo(session.ctx, groupPath, repoName)
if err != nil {
return fmt.Errorf("failed to open repo: %w", err)
}