From 688d8a2d81e2412daa3de298cfcfdd14cd2d1fc6 Mon Sep 17 00:00:00 2001 From: Jesse van den Kieboom Date: Tue, 16 Dec 2014 08:38:34 +0100 Subject: [PATCH] Show all commits if no initial selection in ref list --- gitg/history/gitg-history-refs-list.vala | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/gitg/history/gitg-history-refs-list.vala b/gitg/history/gitg-history-refs-list.vala index 8a968ac6..382441e6 100644 --- a/gitg/history/gitg-history-refs-list.vala +++ b/gitg/history/gitg-history-refs-list.vala @@ -682,7 +682,7 @@ public class RefsList : Gtk.ListBox return; } - add_ref_row(null); + var all_commits = add_ref_row(null); add_header(Gitg.RefType.BRANCH, _("Branches")); add_header(Gitg.RefType.REMOTE, _("Remotes")); @@ -719,10 +719,20 @@ public class RefsList : Gtk.ListBox d_selected_row = null; - if (get_selected_row() == null && head != null) + var sel = get_selected_row(); + + if (sel == null) { - // Select default - select_row(head); + if (head != null) + { + // Select default + select_row(head); + } + else + { + // Select all + select_row(all_commits); + } } thaw_notify();