summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a4da089)
raw | patch | inline | side by side (parent: a4da089)
author | Jonas Fonseca <fonseca@diku.dk> | |
Fri, 9 Jan 2009 18:02:02 +0000 (13:02 -0500) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Sat, 10 Jan 2009 11:01:18 +0000 (06:01 -0500) |
Refactors common parts of begin_update and blame_open.
tig.c | patch | blob | history |
index ba7af0960788322ea513a61e5bad3ab56c0701aa..c80078b85cbb211bf5e60d7476a4352e25c0edc5 100644 (file)
--- a/tig.c
+++ b/tig.c
view->pipe = NULL;
}
+static void
+setup_update(struct view *view, const char *vid)
+{
+ set_nonblocking_input(TRUE);
+ reset_view(view);
+ string_copy_rev(view->vid, vid);
+ view->start_time = time(NULL);
+}
+
static bool
begin_update(struct view *view, bool refresh)
{
if (!view->pipe)
return FALSE;
- set_nonblocking_input(TRUE);
- reset_view(view);
- string_copy_rev(view->vid, view->id);
-
- view->start_time = time(NULL);
+ setup_update(view, view->id);
return TRUE;
}
return FALSE;
}
- reset_view(view);
+ setup_update(view, opt_file);
string_format(view->ref, "%s ...", opt_file);
- string_copy_rev(view->vid, opt_file);
- set_nonblocking_input(TRUE);
- view->start_time = time(NULL);
return TRUE;
}