aboutsummaryrefslogtreecommitdiff
path: root/network/receivepack/service
diff options
context:
space:
mode:
Diffstat (limited to 'network/receivepack/service')
-rw-r--r--network/receivepack/service/hook.go6
-rw-r--r--network/receivepack/service/options.go2
-rw-r--r--network/receivepack/service/run_hook.go1
3 files changed, 7 insertions, 2 deletions
diff --git a/network/receivepack/service/hook.go b/network/receivepack/service/hook.go
index c3be2a76..e3afa375 100644
--- a/network/receivepack/service/hook.go
+++ b/network/receivepack/service/hook.go
@@ -4,6 +4,7 @@ import (
"context"
"io"
+ commitgraphread "codeberg.org/lindenii/furgit/format/commitgraph/read"
objectid "codeberg.org/lindenii/furgit/object/id"
objectstore "codeberg.org/lindenii/furgit/object/store"
refstore "codeberg.org/lindenii/furgit/ref/store"
@@ -27,12 +28,13 @@ type UpdateDecision struct {
// HookRequest is the borrowed view passed to one Hook invocation.
//
-// Refs, ExistingObjects, and QuarantinedObjects are borrowed and are only
-// valid for the duration of the hook call.
+// Refs, ExistingObjects, QuarantinedObjects, and CommitGraph are borrowed and
+// are only valid for the duration of the hook call.
type HookRequest struct {
Refs refstore.ReadingStore
ExistingObjects objectstore.ReadingStore
QuarantinedObjects objectstore.ReadingStore
+ CommitGraph *commitgraphread.Reader
Updates []RefUpdate
PushOptions []string
IO HookIO
diff --git a/network/receivepack/service/options.go b/network/receivepack/service/options.go
index 783afd47..ab867bce 100644
--- a/network/receivepack/service/options.go
+++ b/network/receivepack/service/options.go
@@ -5,6 +5,7 @@ import (
"io/fs"
"os"
+ commitgraphread "codeberg.org/lindenii/furgit/format/commitgraph/read"
objectid "codeberg.org/lindenii/furgit/object/id"
objectstore "codeberg.org/lindenii/furgit/object/store"
refstore "codeberg.org/lindenii/furgit/ref/store"
@@ -27,6 +28,7 @@ type Options struct {
Algorithm objectid.Algorithm
Refs refstore.ReadWriteStore
ExistingObjects objectstore.ReadingStore
+ CommitGraph *commitgraphread.Reader
ObjectsRoot *os.Root
Progress io.Writer
ProgressFlush func() error
diff --git a/network/receivepack/service/run_hook.go b/network/receivepack/service/run_hook.go
index dbfb21f7..ce8f8b7e 100644
--- a/network/receivepack/service/run_hook.go
+++ b/network/receivepack/service/run_hook.go
@@ -122,6 +122,7 @@ func (service *Service) runHook(
Refs: service.opts.Refs,
ExistingObjects: service.opts.ExistingObjects,
QuarantinedObjects: quarantinedObjects,
+ CommitGraph: service.opts.CommitGraph,
Updates: buildHookUpdates(commands),
PushOptions: append([]string(nil), req.PushOptions...),
IO: service.opts.HookIO,