diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
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.
Diffstat (limited to '')
-rw-r--r--source/ui-atom.c4
1 file changed, 4 insertions, 0 deletions
diff --git a/source/ui-atom.c b/source/ui-atom.c
index 0f82c0d..55b59a1 100644
--- a/source/ui-atom.c
+++ b/source/ui-atom.c
@@ -24,6 +24,10 @@
*/
static const char *feed_date(timestamp_t when)
{
+ // The newest commit's date comes straight from git, unclamped, and
+ // git's date code dies on one the system cannot hold.
+ if (date_overflows(when))
+ when = 0;
return show_date(when, 0, date_mode_from_type(DATE_ISO8601_STRICT));
}