about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2025-10-06 18:02:52 +0200
committerRobert Günzler <r@gnzler.io>2025-11-22 22:15:03 +0100
commit9e717e3e8dc1e06bb8e5aa64e44670ea5b667a39 (patch)
treecb319a56879641d19679b02ad180de6fed648062
parentae7d8a29daf25b1505e487c318d0200d577c0e8b (diff)
downloadsite-9e717e3e8dc1e06bb8e5aa64e44670ea5b667a39.tar.gz
handle zero git time
Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to '')
-rw-r--r--src/fs.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/fs.zig b/src/fs.zig
index 8eaf7c2..d6c182d 100644
--- a/src/fs.zig
+++ b/src/fs.zig
@@ -153,10 +153,12 @@ pub fn getGitTime(path: []const u8) !std.posix.timespec {
     try p.spawn();
     _ = try p.stdout.?.readAll(&buf);
     const result = try p.wait();
+
     std.debug.assert(result == .Exited and result.Exited == 0);
 
     // parse result as ulong
     const gitAuthorDate: c_ulong = c.strtoul(&buf, null, 10);
+    if (gitAuthorDate == 0) return error.NoGitTime;
 
     // calculate timespec
     return .{