From 4899f990d79d506ad2b6051c73fdcd8638dfef09 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Thu, 25 Jun 2026 15:56:37 -0700 Subject: [PATCH] Mode: add octal --- git.zig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/git.zig b/git.zig index 3270898af4cdcd86ebd4d4ba8dee1bf3d21b882f..448c80201ce15210aef583fe2dbf900efe9b6325 100644 --- a/git.zig +++ b/git.zig @@ -1814,6 +1814,20 @@ pub const Tree = struct { b[5] = @as(u8, @as(u3, @bitCast(self.perm_other))) + '0'; return b; } + + pub fn octal(self: Mode) u9 { + const O = packed struct { + other: Perm, + group: Perm, + user: Perm, + }; + const o: O = .{ + .other = self.perm_other, + .group = self.perm_group, + .user = self.perm_user, + }; + return @bitCast(o); + } }; pub const Type = enum(u8) { -- 2.54.0