From: Jonas Fonseca Date: Wed, 26 Mar 2008 10:54:28 +0000 (+0100) Subject: Avoid reloading the status view when nothing was updated X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7be144b43e6ab74dd5ad9d8f109e5f2bc84e5118;p=tig.git Avoid reloading the status view when nothing was updated --- diff --git a/tig.c b/tig.c index 6682555..680811f 100644 --- a/tig.c +++ b/tig.c @@ -4193,7 +4193,7 @@ status_update_file(struct view *view, struct status *status, enum line_type type return TRUE; } -static void +static bool status_update(struct view *view) { struct line *line = &view->line[view->lineno]; @@ -4208,12 +4208,14 @@ status_update(struct view *view) if (!line[-1].data) { report("Nothing to update"); - return; + return FALSE; } } else if (!status_update_file(view, line->data, line->type)) { report("Failed to update file status"); } + + return TRUE; } static enum request @@ -4223,7 +4225,8 @@ status_request(struct view *view, enum request request, struct line *line) switch (request) { case REQ_STATUS_UPDATE: - status_update(view); + if (!status_update(view)) + return REQ_NONE; break; case REQ_STATUS_MERGE: