Code

Avoid reloading the status view when nothing was updated
authorJonas Fonseca <fonseca@diku.dk>
Wed, 26 Mar 2008 10:54:28 +0000 (11:54 +0100)
committerJonas Fonseca <fonseca@diku.dk>
Wed, 26 Mar 2008 10:54:28 +0000 (11:54 +0100)
tig.c

diff --git a/tig.c b/tig.c
index 668255543b18e06659c1badb396a0eb364d735e7..680811f24f191d5b54450230c426c193c9613779 100644 (file)
--- 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: