aboutsummaryrefslogtreecommitdiff
path: root/format/packfile/ingest/entry_header.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-30 14:28:13 +0000
committerGravatar Runxi Yu2026-03-30 14:28:13 +0000
commita4eeb727468a178a4de0dfc718828f26740484ac (patch)
tree4318d38d49facc80e2e2186f5919fa656be3b31f /format/packfile/ingest/entry_header.go
parentobject/store/packed: Make store own root, algo, opts (diff)
signatureNo signature
object,store/packed{,/internal/ingest}: Move from format/packfile/ingest
Diffstat (limited to 'format/packfile/ingest/entry_header.go')
-rw-r--r--format/packfile/ingest/entry_header.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/format/packfile/ingest/entry_header.go b/format/packfile/ingest/entry_header.go
deleted file mode 100644
index c74fdc16..00000000
--- a/format/packfile/ingest/entry_header.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package ingest
-
-import (
- "codeberg.org/lindenii/furgit/internal/intconv"
- objecttype "codeberg.org/lindenii/furgit/object/type"
-)
-
-// encodePackEntryHeader encodes one non-delta packed entry header.
-func encodePackEntryHeader(ty objecttype.Type, size int64) []byte {
- var out [16]byte
-
- n := 0
-
- s, err := intconv.Int64ToUint64(size)
- if err != nil {
- panic(err)
- }
-
- c := (uint8(ty) << 4) | byte(s&0x0f)
-
- s >>= 4
- for s != 0 {
- out[n] = c | 0x80
- n++
- c = byte(s & 0x7f)
- s >>= 7
- }
-
- out[n] = c
- n++
-
- return append([]byte(nil), out[:n]...)
-}