| ... | ... | @@ -272,12 +272,13 @@ pub fn build(b: *std.Build) !void { |
| 272 | 272 | const io = b.graph.io; |
| 273 | 273 | const git_file = b.root.openFile(io, ".git", .{ .allow_directory = false }) catch |err| switch (err) { |
| 274 | 274 | error.IsDir => { |
| 275 | | b.dependOnFileContents(b.path(".git/logs/HEAD")); |
| 275 | b.dependOnFileMetadata(b.path(".git/logs/HEAD")); |
| 276 | 276 | break :git; |
| 277 | 277 | }, |
| 278 | 278 | else => |e| return e, |
| 279 | 279 | }; |
| 280 | 280 | defer git_file.close(io); |
| 281 | b.dependOnFileContents(b.path(".git")); |
| 281 | 282 | var line_buffer: ["gitdir: ".len + std.Io.Dir.max_path_bytes + 1]u8 = undefined; |
| 282 | 283 | var git_file_reader = git_file.reader(io, &line_buffer); |
| 283 | 284 | if (std.mem.cutPrefix(u8, std.mem.trimEnd(u8, try git_file_reader.interface.allocRemaining( |
| ... | ... | @@ -285,7 +286,7 @@ pub fn build(b: *std.Build) !void { |
| 285 | 286 | .limited("gitdir: ".len + std.Io.Dir.max_path_bytes + "\r\n".len), |
| 286 | 287 | ), "\r\n"), "gitdir: ")) |git_dir| { |
| 287 | 288 | const head_file = b.pathJoin(&.{ git_dir, "logs", "HEAD" }); |
| 288 | | b.dependOnFileContents(if (std.Io.Dir.path.isAbsolute(head_file)) |
| 289 | b.dependOnFileMetadata(if (std.Io.Dir.path.isAbsolute(head_file)) |
| 289 | 290 | b.graph.cwdRelativePath(head_file) |
| 290 | 291 | else |
| 291 | 292 | b.path(head_file)); |