From 74323336d4df16c9465109dd72cee4316afbb04f Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sat, 19 Dec 2009 23:11:12 -0500 Subject: [PATCH] Only draw dates with non-zero seconds --- tig.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tig.c b/tig.c index 81b85e7..c1dd513 100644 --- a/tig.c +++ b/tig.c @@ -2245,7 +2245,7 @@ draw_field(struct view *view, enum line_type type, const char *text, int len, bo static bool draw_date(struct view *view, struct time *time) { - const char *date = time ? mkdate(time) : ""; + const char *date = time && time->sec ? mkdate(time) : ""; int cols = opt_date == DATE_SHORT ? DATE_SHORT_COLS : DATE_COLS; return draw_field(view, LINE_DATE, date, cols, FALSE); @@ -4459,7 +4459,7 @@ tree_draw(struct view *view, struct line *line, unsigned int lineno) if (opt_author && draw_author(view, entry->author)) return TRUE; - if (opt_date && draw_date(view, entry->author ? &entry->time : NULL)) + if (opt_date && draw_date(view, &entry->time)) return TRUE; } if (draw_text(view, line->type, entry->name, TRUE)) @@ -5140,7 +5140,7 @@ branch_draw(struct view *view, struct line *line, unsigned int lineno) struct branch *branch = line->data; enum line_type type = branch->ref->head ? LINE_MAIN_HEAD : LINE_DEFAULT; - if (opt_date && draw_date(view, branch->author ? &branch->time : NULL)) + if (opt_date && draw_date(view, &branch->time)) return TRUE; if (opt_author && draw_author(view, branch->author)) -- 2.30.2