aboutsummaryrefslogtreecommitdiff
path: root/object/tree/mode/mode.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-06-07 11:01:26 +0000
committerGravatar Runxi Yu2026-06-07 11:04:43 +0000
commitc2d883c7c58a3bd64d799dd000fe7254e450a4e5 (patch)
treea4456d8fc3718f235c2e934d42c056b3bcd3e1f9 /object/tree/mode/mode.go
parentobject/tag: Add (diff)
object/tree/mode: Initialize
Diffstat (limited to 'object/tree/mode/mode.go')
-rw-r--r--object/tree/mode/mode.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/object/tree/mode/mode.go b/object/tree/mode/mode.go
new file mode 100644
index 00000000..70b6fd38
--- /dev/null
+++ b/object/tree/mode/mode.go
@@ -0,0 +1,24 @@
+package mode
+
+// Mode represents the mode of an entry in a Git tree.
+type Mode uint32
+
+const (
+ // Directory is the mode of a subtree entry.
+ Directory Mode = 0o40000
+
+ // Regular is the mode of a non-executable regular file.
+ Regular Mode = 0o100644
+
+ // Executable is the mode of an executable regular file.
+ Executable Mode = 0o100755
+
+ // Symlink is the mode of a symbolic link.
+ Symlink Mode = 0o120000
+
+ // Gitlink is the mode of a gitlink (submodule commit) entry.
+ Gitlink Mode = 0o160000
+)
+
+// maxModeDigits is the largest number of octal digits in any canonical mode.
+const maxModeDigits = 6