aboutsummaryrefslogtreecommitdiff
path: root/receivepack/hook.go
diff options
context:
space:
mode:
Diffstat (limited to 'receivepack/hook.go')
-rw-r--r--receivepack/hook.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/receivepack/hook.go b/receivepack/hook.go
index c96911ac..bdb0b087 100644
--- a/receivepack/hook.go
+++ b/receivepack/hook.go
@@ -2,6 +2,7 @@ package receivepack
import (
"context"
+ "io"
"codeberg.org/lindenii/furgit/objectid"
"codeberg.org/lindenii/furgit/objectstore"
@@ -9,6 +10,11 @@ import (
"codeberg.org/lindenii/furgit/refstore"
)
+type HookIO struct {
+ Progress io.Writer
+ Error io.Writer
+}
+
// RefUpdate is one requested reference update presented to a receive-pack hook.
type RefUpdate struct {
Name string
@@ -30,6 +36,7 @@ type HookRequest struct {
QuarantinedObjects objectstore.Store
Updates []RefUpdate
PushOptions []string
+ IO HookIO
}
// Hook decides whether each requested update should proceed.
@@ -60,6 +67,10 @@ func translateHook(hook Hook) service.Hook {
QuarantinedObjects: req.QuarantinedObjects,
Updates: translatedUpdates,
PushOptions: append([]string(nil), req.PushOptions...),
+ IO: HookIO{
+ Progress: req.IO.Progress,
+ Error: req.IO.Error,
+ },
})
if err != nil {
return nil, err