| author | |
| committer | |
| log | 4ddb283ecc975d6d9aae9177d0423de2946ce58e |
| tree | 58807ad03edb3ee24c526c2557ed182ee08bb083 |
| parent | ca1b8dcc2891fc1b344e8d602cc593694a1e5008 |
1 files changed, 7 insertions(+), 0 deletions(-)
git.zig+7| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | const std = @import("std"); |
| 2 | 2 | const string = []const u8; |
| 3 | const top = @This(); | |
| 3 | 4 | |
| 4 | 5 | // 40 is length of sha1 hash |
| 5 | 6 | pub const Id = *const [40]u8; |
| ... | ... | @@ -147,6 +148,12 @@ pub const Tree = struct { |
| 147 | 148 | commit: CommitId, |
| 148 | 149 | |
| 149 | 150 | pub const Tag = std.meta.Tag(@This()); |
| 151 | ||
| 152 | pub fn erase(self: @This()) top.Id { | |
| 153 | return switch (self) { | |
| 154 | inline else => |v| v.id, | |
| 155 | }; | |
| 156 | } | |
| 150 | 157 | }; |
| 151 | 158 | |
| 152 | 159 | pub const Mode = struct { |