Code

Make the branch view always prepare how the main view is loaded
authorJonas Fonseca <fonseca@diku.dk>
Fri, 4 Jun 2010 22:55:01 +0000 (18:55 -0400)
committerJonas Fonseca <fonseca@diku.dk>
Fri, 4 Jun 2010 22:55:01 +0000 (18:55 -0400)
tig.c

diff --git a/tig.c b/tig.c
index 209be27f0d06fbc7a45c71a81ac555edc2d590fe..3e4d369063259d67589aabae0c8a8a47d871148a 100644 (file)
--- 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;
        }