aboutsummaryrefslogtreecommitdiff
path: root/internal/format
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-06-10 18:28:02 +0000
committerGravatar Runxi Yu2026-06-10 18:28:02 +0000
commit42cdcaa9a0d6d7ed6c776520f646d110ebf641dc (patch)
tree624408a6a8806044c797423b22d7ea007b9aab82 /internal/format
parentinternal/format: Add doc (diff)
internal/format/packfile: Add simple header functions
Diffstat (limited to 'internal/format')
-rw-r--r--internal/format/packfile/doc.go2
-rw-r--r--internal/format/packfile/header.go9
2 files changed, 11 insertions, 0 deletions
diff --git a/internal/format/packfile/doc.go b/internal/format/packfile/doc.go
new file mode 100644
index 00000000..d656e256
--- /dev/null
+++ b/internal/format/packfile/doc.go
@@ -0,0 +1,2 @@
+// Package packfile provides Git packfile format parsing primitives.
+package packfile
diff --git a/internal/format/packfile/header.go b/internal/format/packfile/header.go
new file mode 100644
index 00000000..1a156f36
--- /dev/null
+++ b/internal/format/packfile/header.go
@@ -0,0 +1,9 @@
+package packfile
+
+// Signature is the 4-byte "PACK" magic at the start of pack files.
+const Signature = 0x5041434b
+
+// SupportedVersion reports whether a pack version is supported.
+func SupportedVersion(version uint32) bool {
+ return version == 2
+}