aboutsummaryrefslogtreecommitdiff
path: root/format/pack/ingest/entry_header.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-10 14:07:54 +0800
committerGravatar Runxi Yu2026-03-10 14:07:54 +0800
commitc2cb06aa23a1769a0d84756acccf1ac1358f61ef (patch)
tree86d991b67542dd8e8509a74c832b749ccf948342 /format/pack/ingest/entry_header.go
parentcommitgraph: Move out of format/ (diff)
signatureNo signature
*: format/pack -> packfile; format/delta -> delta; delete format
Diffstat (limited to 'format/pack/ingest/entry_header.go')
-rw-r--r--format/pack/ingest/entry_header.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/format/pack/ingest/entry_header.go b/format/pack/ingest/entry_header.go
deleted file mode 100644
index 54f63fac..00000000
--- a/format/pack/ingest/entry_header.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package ingest
-
-import (
- "codeberg.org/lindenii/furgit/internal/intconv"
- "codeberg.org/lindenii/furgit/objecttype"
-)
-
-// 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]...)
-}