From f71e4c7b0450488676cabc7955b48a2e802bc9a2 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 7 Oct 2025 10:18:22 +0200 Subject: [PATCH] fix(wsl): use zero mtime if statFile fails --- src/Project.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Project.zig b/src/Project.zig index 017c12c..4f5e757 100644 --- a/src/Project.zig +++ b/src/Project.zig @@ -2064,14 +2064,16 @@ pub fn process_git(self: *Self, parent: tp.pid_ref, m: tp.message) (OutOfMemoryE try self.loaded(parent); } else if (try m.match(.{ tp.any, tp.any, "workspace_files", tp.extract(&path) })) { self.longest_file_path = @max(self.longest_file_path, path.len); - const stat = std.fs.cwd().statFile(path) catch return; + const mtime: i128 = blk: { + break :blk (std.fs.cwd().statFile(path) catch break :blk 0).mtime; + }; const file_type: []const u8, const file_icon: []const u8, const file_color: u24 = guess_file_type(path); (try self.pending.addOne(self.allocator)).* = .{ .path = try self.allocator.dupe(u8, path), .type = file_type, .icon = file_icon, .color = file_color, - .mtime = stat.mtime, + .mtime = mtime, }; } else if (try m.match(.{ tp.any, tp.any, "workspace_files", tp.null_ })) { self.state.workspace_files = .done;