From: Jonas Fonseca Date: Fri, 4 Jun 2010 22:55:01 +0000 (-0400) Subject: Make the branch view always prepare how the main view is loaded X-Git-Url: https://git.tokkee.org/?p=tig.git;a=commitdiff_plain;h=4702c2a6720b8480acf5698e77848710e018b28d Make the branch view always prepare how the main view is loaded --- diff --git a/tig.c b/tig.c index 209be27..3e4d369 100644 --- a/tig.c +++ b/tig.c @@ -5335,23 +5335,21 @@ branch_request(struct view *view, enum request request, struct line *line) return REQ_NONE; case REQ_ENTER: - if (branch->ref == &branch_all) { - const char *all_branches_argv[] = { - "git", "log", "--no-color", "--pretty=raw", "--parents", - "--topo-order", "--all", NULL - }; - struct view *main_view = VIEW(REQ_VIEW_MAIN); + { + const struct ref *ref = branch->ref; + const char *all_branches_argv[] = { + "git", "log", "--no-color", "--pretty=raw", "--parents", + "--topo-order", + ref == &branch_all ? "--all" : ref->name, NULL + }; + struct view *main_view = VIEW(REQ_VIEW_MAIN); - if (!prepare_update(main_view, all_branches_argv, NULL)) { - report("Failed to load view of all branches"); - return REQ_NONE; - } + if (!prepare_update(main_view, all_branches_argv, NULL)) + report("Failed to load view of all branches"); + else open_view(view, REQ_VIEW_MAIN, OPEN_PREPARED | OPEN_SPLIT); - } else { - open_view(view, REQ_VIEW_MAIN, OPEN_SPLIT); - } return REQ_NONE; - + } default: return request; }