summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: df711b9)
raw | patch | inline | side by side (parent: df711b9)
author | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 22 Apr 2008 10:57:02 +0000 (12:57 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 22 Apr 2008 10:57:02 +0000 (12:57 +0200) |
Always wait for the final blame information (the commit filename) to be
read before showing any commit information.
read before showing any commit information.
tig.c | patch | blob | history |
index 8affff1e8a269567d33a13a77180bc8e88e229f2..88e32201508edb5c1e9c592ba888ec871baa0306 100644 (file)
--- a/tig.c
+++ b/tig.c
blame_draw(struct view *view, struct line *line, unsigned int lineno)
{
struct blame *blame = line->data;
+ struct tm *time = NULL;
+ char *id = NULL, *author = NULL;
int col = 0;
- if (opt_date) {
- struct tm *time = blame->commit && *blame->commit->filename
- ? &blame->commit->time : NULL;
+ if (blame->commit && *blame->commit->filename) {
+ id = blame->commit->id;
+ author = blame->commit->author;
+ time = &blame->commit->time;
+ }
+ if (opt_date) {
col += draw_date(view, time, view->width);
if (col >= view->width)
return TRUE;
int max = MIN(AUTHOR_COLS - 1, view->width - col);
set_view_attr(view, LINE_MAIN_AUTHOR);
- if (blame->commit)
- draw_text(view, LINE_MAIN_AUTHOR, blame->commit->author, max, TRUE);
+ if (author)
+ draw_text(view, LINE_MAIN_AUTHOR, author, max, TRUE);
col += AUTHOR_COLS;
if (col >= view->width)
return TRUE;
int max = MIN(ID_COLS - 1, view->width - col);
set_view_attr(view, LINE_BLAME_ID);
- if (blame->commit)
- draw_text(view, LINE_BLAME_ID, blame->commit->id, max, FALSE);
+ if (id)
+ draw_text(view, LINE_BLAME_ID, id, max, FALSE);
col += ID_COLS;
if (col >= view->width)
return TRUE;