| ... | ... | @@ -514,6 +514,11 @@ pub const Manifest = struct { |
| 514 | 514 | pub fn path(off: File.Offset, contents: []const u8) [:0]const u8 { |
| 515 | 515 | return pathFallible(off, contents) catch unreachable; |
| 516 | 516 | } |
| 517 | |
| 518 | pub fn pathOrDot(off: File.Offset, contents: []const u8) [:0]const u8 { |
| 519 | const p = pathFallible(off, contents) catch unreachable; |
| 520 | return if (p.len == 0) "." else p; |
| 521 | } |
| 517 | 522 | }; |
| 518 | 523 | |
| 519 | 524 | /// Intentionally matches if the files are different only by flags other than prefix. |
| ... | ... | @@ -1176,7 +1181,7 @@ pub const Manifest = struct { |
| 1176 | 1181 | const io = cache.io; |
| 1177 | 1182 | const input_file = file_off.get(contents); |
| 1178 | 1183 | const parent_dir = cache.prefixes()[input_file.flags.prefix].handle; |
| 1179 | | const file_path = file_off.path(contents); |
| 1184 | const file_path = file_off.pathOrDot(contents); |
| 1180 | 1185 | const gpa = cache.gpa; |
| 1181 | 1186 | |
| 1182 | 1187 | if (input_path.have_digest) return; |
| ... | ... | @@ -1352,7 +1357,7 @@ pub const Manifest = struct { |
| 1352 | 1357 | const disk_file = file_off.get(disk_contents); |
| 1353 | 1358 | const input_file = file_off.get(input_contents); |
| 1354 | 1359 | const parent_dir = cache.prefixes()[disk_file.flags.prefix].handle; |
| 1355 | | const file_path = file_off.path(disk_contents); |
| 1360 | const file_path = file_off.pathOrDot(disk_contents); |
| 1356 | 1361 | |
| 1357 | 1362 | assert(disk_file.flags == input_file.flags); |
| 1358 | 1363 | |
| ... | ... | @@ -1536,7 +1541,7 @@ pub const Manifest = struct { |
| 1536 | 1541 | const gpa = cache.gpa; |
| 1537 | 1542 | const io = cache.io; |
| 1538 | 1543 | const parent_dir = cache.prefixes()[file.flags.prefix].handle; |
| 1539 | | const file_path = file_off.path(contents); |
| 1544 | const file_path = file_off.pathOrDot(contents); |
| 1540 | 1545 | |
| 1541 | 1546 | if (file.flags.metadata_only) { |
| 1542 | 1547 | const actual_stat = parent_dir.statFile(io, file_path, .{}) catch |err| switch (err) { |