Code

Fix reopening blame view when it is already loading
authorJonas Fonseca <fonseca@diku.dk>
Mon, 28 Apr 2008 19:05:47 +0000 (21:05 +0200)
committerJonas Fonseca <fonseca@diku.dk>
Mon, 28 Apr 2008 19:51:01 +0000 (21:51 +0200)
Move call to end_update() if view->pipe is non-NULL from begin_update()
to open_view() so it is called also for views that defines an open()
operation.

Triggered by Jeff King's "show blame for parent" patch posted to the
git mailing list in <20080410040213.GA29618@sigill.intra.peff.net>.

tig.c

diff --git a/tig.c b/tig.c
index 14fbf35a9f834eef1d392848a314944a37a3516c..d96b834517d00d2b54e9186a71bf6483cf14d35a 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -2181,9 +2181,6 @@ end_update(struct view *view, bool force)
 static bool
 begin_update(struct view *view)
 {
-       if (view->pipe)
-               end_update(view, TRUE);
-
        if (opt_cmd[0]) {
                string_copy(view->cmd, opt_cmd);
                opt_cmd[0] = 0;
@@ -2474,6 +2471,9 @@ open_view(struct view *prev, enum request request, enum open_flags flags)
            (nviews == 1 && base_view != display[0]))
                resize_display();
 
+       if (view->pipe)
+               end_update(view, TRUE);
+
        if (view->ops->open) {
                if (!view->ops->open(view)) {
                        report("Failed to load %s view", view->name);