| ... | ... | @@ -233,6 +233,7 @@ pub fn do_hash(alloc: std.mem.Allocator, comptime algo: type, data: string) !str |
| 233 | 233 | pub fn git_rev_HEAD(alloc: std.mem.Allocator, dir: std.fs.Dir) !string { |
| 234 | 234 | const dirg = try dir.openDir(".git", .{}); |
| 235 | 235 | const h = std.mem.trim(u8, try dirg.readFileAlloc(alloc, "HEAD", 50), "\n"); |
| 236 | if (!std.mem.startsWith(u8, h, "ref:")) return h; |
| 236 | 237 | const r = std.mem.trim(u8, try dirg.readFileAlloc(alloc, h[5..], 50), "\n"); |
| 237 | 238 | return r; |
| 238 | 239 | } |