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: Update docs

Runxi Yu e75510d1 69d68ffe

+9 -15
+2 -4
network/receivepack/hook.go
··· 32 32 // HookRequest is the input presented to a receive-pack hook before quarantine 33 33 // promotion and ref updates. 34 34 // 35 - // Refs, ExistingObjects, QuarantinedObjects, and CommitGraph are borrowed and 36 - // are only valid for the duration of the hook call. 35 + // Labels: Life-Call. 37 36 type HookRequest struct { 38 37 Refs refstore.ReadingStore 39 38 ExistingObjects objectstore.ReadingStore ··· 48 47 // 49 48 // The hook runs after pack ingestion into quarantine and before quarantine 50 49 // promotion or ref updates. The returned decisions must have the same length as 51 - // HookRequest.Updates. Hook borrows the data and stores in HookRequest only for 52 - // the duration of the call. 50 + // HookRequest.Updates. 53 51 type Hook func(context.Context, HookRequest) ([]UpdateDecision, error) 54 52 55 53 func translateHook(hook Hook) service.Hook {
+1 -2
network/receivepack/receivepack.go
··· 20 20 21 21 // ReceivePack serves one receive-pack session over r/w. 22 22 // 23 - // ReceivePack borrows r, w, and all dependencies reachable through opts for 24 - // the duration of the call. It does not close any of them. 23 + // Labels: Deps-Borrowed. 25 24 func ReceivePack( 26 25 ctx context.Context, 27 26 w pktline.WriteFlusher,
+2
network/receivepack/service/execute.go
··· 9 9 10 10 // Execute validates one receive-pack request, optionally ingests its pack into 11 11 // quarantine, runs the optional hook, and applies allowed ref updates. 12 + // 13 + // Labels: Deps-Borrowed. 12 14 func (service *Service) Execute(ctx context.Context, req *Request) (*Result, error) { 13 15 result := &Result{ 14 16 Commands: make([]CommandResult, 0, len(req.Commands)),
+3 -5
network/receivepack/service/hook.go
··· 26 26 Message string 27 27 } 28 28 29 - // HookRequest is the borrowed view passed to one Hook invocation. 29 + // HookRequest is the view passed to one Hook invocation. 30 30 // 31 - // Refs, ExistingObjects, QuarantinedObjects, and CommitGraph are borrowed and 32 - // are only valid for the duration of the hook call. 31 + // Labels: Life-Call. 33 32 type HookRequest struct { 34 33 Refs refstore.ReadingStore 35 34 ExistingObjects objectstore.ReadingStore ··· 42 41 43 42 // Hook is an optional per-request validation hook. 44 43 // 45 - // Hook borrows the data and stores in HookRequest only for the duration of the 46 - // call. 44 + // The returned decisions must have the same length as HookRequest.Updates. 47 45 type Hook func(context.Context, HookRequest) ([]UpdateDecision, error)
+1 -4
network/receivepack/service/service.go
··· 1 1 package service 2 2 3 3 // Service executes protocol-independent receive-pack requests. 4 - // 5 - // Service borrows all dependencies supplied in Options. 6 4 type Service struct { 7 5 opts Options 8 6 } 9 7 10 8 // New creates one receive-pack service. 11 9 // 12 - // The returned service borrows opts and does not take ownership of any stores, 13 - // roots, hooks, or I/O endpoints reachable through it. 10 + // Labels: Deps-Borrowed. 14 11 func New(opts Options) *Service { 15 12 return &Service{opts: opts} 16 13 }