Fast implementation of Git in pure Go codeberg.org/lindenii/furgit
git go
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

network/receivepack: Cleanup; also document QuarantinedObjects nullness

Runxi Yu 82f8ae03 da621b97

+15 -11
+5 -2
network/receivepack/hook.go
··· 34 34 // 35 35 // Labels: Life-Call. 36 36 type HookRequest struct { 37 - Refs refstore.ReadingStore 38 - ExistingObjects objectstore.Reader 37 + Refs refstore.ReadingStore 38 + ExistingObjects objectstore.Reader 39 + // QuarantinedObjects exposes quarantined objects for this push. 40 + // 41 + // When the push did not create a quarantine, QuarantinedObjects is nil. 39 42 QuarantinedObjects objectstore.Reader 40 43 CommitGraph *commitgraphread.Reader 41 44 Updates []RefUpdate
+4 -1
network/receivepack/hooks/reject_force_push.go
··· 21 21 ) ([]receivepack.UpdateDecision, error) { 22 22 _ = ctx 23 23 24 - objects := objectmix.New(req.QuarantinedObjects, req.ExistingObjects) 24 + objects := req.ExistingObjects 25 + if req.QuarantinedObjects != nil { 26 + objects = objectmix.New(req.QuarantinedObjects, req.ExistingObjects) 27 + } 25 28 26 29 queries := commitquery.New(fetch.New(objects), req.CommitGraph) 27 30
-1
network/receivepack/receivepack.go
··· 105 105 } 106 106 107 107 svc := service.New(service.Options{ 108 - Algorithm: opts.Algorithm, 109 108 Refs: opts.Refs, 110 109 ExistingObjects: opts.ExistingObjects, 111 110 ObjectIngress: opts.ObjectIngress,
+5 -2
network/receivepack/service/hook.go
··· 30 30 // 31 31 // Labels: Life-Call. 32 32 type HookRequest struct { 33 - Refs refstore.ReadingStore 34 - ExistingObjects objectstore.Reader 33 + Refs refstore.ReadingStore 34 + ExistingObjects objectstore.Reader 35 + // QuarantinedObjects exposes quarantined objects for this push. 36 + // 37 + // When the push did not create a quarantine, QuarantinedObjects is nil. 35 38 QuarantinedObjects objectstore.Reader 36 39 CommitGraph *commitgraphread.Reader 37 40 Updates []RefUpdate
+1 -3
network/receivepack/service/options.go
··· 3 3 import ( 4 4 "codeberg.org/lindenii/furgit/common/iowrap" 5 5 commitgraphread "codeberg.org/lindenii/furgit/format/commitgraph/read" 6 - objectid "codeberg.org/lindenii/furgit/object/id" 7 6 objectstore "codeberg.org/lindenii/furgit/object/store" 8 7 refstore "codeberg.org/lindenii/furgit/ref/store" 9 8 ) ··· 18 17 // CommitGraph, Progress, Hook, and HookIO are optional; when provided they are also 19 18 // borrowed for the duration of Execute. 20 19 type Options struct { 21 - Algorithm objectid.Algorithm 22 - Refs interface { 20 + Refs interface { 23 21 refstore.ReadingStore 24 22 refstore.TransactionalStore 25 23 refstore.BatchStore
-2
network/receivepack/service/service_test.go
··· 25 25 26 26 store := memory.New(algo) 27 27 svc := service.New(service.Options{ 28 - Algorithm: algo, 29 28 ExistingObjects: store, 30 29 }) 31 30 ··· 59 58 objectIngress := newDualIngress(t, algo) 60 59 61 60 svc := service.New(service.Options{ 62 - Algorithm: algo, 63 61 ExistingObjects: store, 64 62 ObjectIngress: objectIngress, 65 63 })