diff options
| author | 2026-03-30 14:28:13 +0000 | |
|---|---|---|
| committer | 2026-03-30 14:28:13 +0000 | |
| commit | a4eeb727468a178a4de0dfc718828f26740484ac (patch) | |
| tree | 4318d38d49facc80e2e2186f5919fa656be3b31f /format/packfile/ingest/state.go | |
| parent | object/store/packed: Make store own root, algo, opts (diff) | |
| signature | No signature | |
object,store/packed{,/internal/ingest}: Move from format/packfile/ingest
Diffstat (limited to 'format/packfile/ingest/state.go')
| -rw-r--r-- | format/packfile/ingest/state.go | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/format/packfile/ingest/state.go b/format/packfile/ingest/state.go deleted file mode 100644 index 797323b2..00000000 --- a/format/packfile/ingest/state.go +++ /dev/null @@ -1,70 +0,0 @@ -package ingest - -import ( - "io" - "os" - - objectid "codeberg.org/lindenii/furgit/object/id" -) - -const ( - defaultDeltaBaseCacheMaxBytes = 32 << 20 -) - -// ingestState holds mutable state for one Ingest call. -type ingestState struct { - src io.Reader - destination *os.Root - algo objectid.Algorithm - opts Options - - packHeaderRaw [packHeaderSize]byte - - packFile *os.File - packTmpName string - idxFile *os.File - idxTmpName string - revFile *os.File - revTmpName string - - stream *streamScanner - - records []objectRecord - ofsDeltas []ofsDeltaRef - refDeltas []refDeltaRef - unresolvedRefDeltas []int - offsetToRecord map[uint64]int - objectToRecord map[objectid.ObjectID]int - - baseCache *deltaBaseCache - packHash objectid.ObjectID - - objectCountHeader uint32 - thinFixed bool -} - -// newIngestState constructs one call-local ingest state. -func newIngestState( - src io.Reader, - destination *os.Root, - algo objectid.Algorithm, - opts Options, - header HeaderInfo, - headerRaw [packHeaderSize]byte, -) (*ingestState, error) { - if algo.Size() == 0 { - return nil, objectid.ErrInvalidAlgorithm - } - - return &ingestState{ - src: src, - destination: destination, - algo: algo, - opts: opts, - packHeaderRaw: headerRaw, - objectCountHeader: header.ObjectCount, - offsetToRecord: make(map[uint64]int), - objectToRecord: make(map[objectid.ObjectID]int), - baseCache: newDeltaBaseCache(defaultDeltaBaseCacheMaxBytes), - }, nil -} |
