summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cbe1676)
raw | patch | inline | side by side (parent: cbe1676)
author | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 31 Dec 2008 17:55:33 +0000 (12:55 -0500) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 31 Dec 2008 17:55:33 +0000 (12:55 -0500) |
tig.c | patch | blob | history |
index d2bc2dd46555008a03b6aa903fea78ea304ecfbf..fe57bf4c6bb751dc4c5cb01204127781046819be 100644 (file)
--- a/tig.c
+++ b/tig.c
}
static bool
-blame_read_file(struct view *view, const char *line)
+blame_read_file(struct view *view, const char *line, bool *read_file)
{
if (!line) {
FILE *pipe = NULL;
pipe = popen(view->cmd, "r");
else if (!view->parent)
die("No blame exist for %s", view->vid);
- view->cmd[0] = 0;
if (!pipe) {
report("Failed to load blame data");
return TRUE;
fclose(view->pipe);
view->pipe = pipe;
+ *read_file = FALSE;
return FALSE;
} else {
static struct blame_commit *commit = NULL;
static int blamed = 0;
static time_t author_time;
+ static bool read_file = TRUE;
- if (*view->cmd)
- return blame_read_file(view, line);
+ if (read_file)
+ return blame_read_file(view, line, &read_file);
if (!line) {
/* Reset all! */
commit = NULL;
blamed = 0;
+ read_file = TRUE;
string_format(view->ref, "%s", view->vid);
if (view_is_displayed(view)) {
update_view_title(view);