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) {