From 7be144b43e6ab74dd5ad9d8f109e5f2bc84e5118 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Wed, 26 Mar 2008 11:54:28 +0100 Subject: [PATCH] Avoid reloading the status view when nothing was updated --- tig.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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: -- 2.30.2