aboutsummaryrefslogtreecommitdiff
path: root/receivepack/receivepack.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-07 22:00:51 +0800
committerGravatar Runxi Yu2026-03-07 22:03:26 +0800
commit7d0f942b3ae4903dded72a9524f6bd4ffa16feb9 (patch)
tree32cbfc7841dc59759618c07905675cc3ece1c5a1 /receivepack/receivepack.go
parentprotocol/v0v1/server: Add ProgessWriter and ErrorWriter (diff)
signatureNo signature
receivepack: Add HookIO
Diffstat (limited to 'receivepack/receivepack.go')
-rw-r--r--receivepack/receivepack.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/receivepack/receivepack.go b/receivepack/receivepack.go
index d1e54e58..4c1912cf 100644
--- a/receivepack/receivepack.go
+++ b/receivepack/receivepack.go
@@ -10,6 +10,14 @@ import (
"codeberg.org/lindenii/furgit/receivepack/internal/service"
)
+// TODO: Some more designing to do. In particular, we'd like to have access to
+// commit graphs and stored object abstractions and such here, especially because
+// hooks might want to access full repos, but we risk creating
+// circular dependencies if we import repository/ here. Might need an interface-ish
+// design, but that risks being over-complicated.
+// Theoretically we could also just give the hooks an os.Root but that
+// feels a bit ugly.
+
// ReceivePack serves one receive-pack session over r/w.
func ReceivePack(
ctx context.Context,
@@ -75,6 +83,10 @@ func ReceivePack(
opts.PromotedObjectPermissions,
),
Hook: translateHook(opts.Hook),
+ HookIO: service.HookIO{
+ Progress: base.ProgressWriter(),
+ Error: base.ErrorWriter(),
+ },
})
result, err := svc.Execute(ctx, serviceReq)