From d3aa4c43edb0e3d385a13a9915ea96bc55c22b06 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 17 Oct 2026 17:09:14 -1000 Subject: Show an odd pushed date rather than die on it A date past what the system holds, a zone that is no hhmm offset, or a date earlier than its own westward offset all made git die inside show_date, which took the summary, refs, log, commit and feed pages of the repository down. They are now clamped as git's own log clamps them. --- source/ui-shared.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/ui-shared.c') diff --git a/source/ui-shared.c b/source/ui-shared.c index a0a0664..d1b9994 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -1418,9 +1418,9 @@ void cgit_print_age(time_t t, int tz, time_t max_relative) if (!t) return; time(&now); - secs = now - t; - if (secs < 0) - secs = 0; + // A date past now, or one so far off that the difference cannot be + // held, reads as no age at all. + secs = t > now ? 0 : now - t; if (!ctx.cfg.enable_relative_dates || (secs > max_relative && max_relative >= 0)) { print_abs_date(t, tz); -- cgit