Code

update_view: Check the pipes and call end_update() before redrawing
authorJonas Fonseca <fonseca@diku.dk>
Wed, 15 Oct 2008 08:14:33 +0000 (10:14 +0200)
committerJonas Fonseca <fonseca@diku.dk>
Wed, 15 Oct 2008 08:16:34 +0000 (10:16 +0200)
This allows the main view to finish its updating of the revision graph
so that it is rendered properly for the last commit. As a bonus, it also
removes a goto.

NEWS
tig.c

diff --git a/NEWS b/NEWS
index 5719d46ea9e4e6516bd901b414bc629dd710b436..d192439815163a81dd250b23f34d9f90b7c9f758 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Improvements:
 Bug fixes:
 
  - Separate blame revision and file argument by "--" to avoid problems.
+ - Main view: fix redrawing of the last commit wrt. the revision graph.
 
 tig-0.12.1
 ----------
diff --git a/tig.c b/tig.c
index f436571c1f4dfb4e5b4294c3200aeb8d62b4896e..b5078c0e2ebf074d6fbbc223b6679020970b86b0 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -2378,8 +2378,14 @@ update_view(struct view *view)
                }
        }
 
-       if (!view_is_displayed(view))
-               goto check_pipe;
+       if (ferror(view->pipe) && errno != 0) {
+               report("Failed to read: %s", strerror(errno));
+               end_update(view, TRUE);
+
+       } else if (feof(view->pipe)) {
+               report("");
+               end_update(view, FALSE);
+       }
 
        if (view == VIEW(REQ_VIEW_TREE)) {
                /* Clear the view and redraw everything since the tree sorting
@@ -2409,17 +2415,6 @@ update_view(struct view *view)
        /* Update the title _after_ the redraw so that if the redraw picks up a
         * commit reference in view->ref it'll be available here. */
        update_view_title(view);
-
-check_pipe:
-       if (ferror(view->pipe) && errno != 0) {
-               report("Failed to read: %s", strerror(errno));
-               end_update(view, TRUE);
-
-       } else if (feof(view->pipe)) {
-               report("");
-               end_update(view, FALSE);
-       }
-
        return TRUE;
 
 alloc_error: