diff options
| author | 2026-02-20 22:22:32 +0800 | |
|---|---|---|
| committer | 2026-02-20 22:22:32 +0800 | |
| commit | b3b2d5057a55baf88cbaaa31234edd3fe5d30e7f (patch) | |
| tree | 4b9c225deaa6dff93b43f50fc5e3f8ce3d9923e4 /internal/objectheader/encode.go | |
| parent | object: Use objecttype instead of doing object types ourself (diff) | |
| signature | No signature | |
objectheader: Add loose-object header parsing and emitting code
Diffstat (limited to 'internal/objectheader/encode.go')
| -rw-r--r-- | internal/objectheader/encode.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/objectheader/encode.go b/internal/objectheader/encode.go new file mode 100644 index 00000000..1cca968b --- /dev/null +++ b/internal/objectheader/encode.go @@ -0,0 +1,8 @@ +package objectheader + +import "codeberg.org/lindenii/furgit/objecttype" + +// Encode returns a canonical loose-object header ("type size\\x00"). +func Encode(ty objecttype.Type, size int64) ([]byte, bool) { + return Append(nil, ty, size) +} |
