aboutsummaryrefslogtreecommitdiff
path: root/internal/format
diff options
context:
space:
mode:
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
+}