git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[EGIT PATCH] Select and show a newly created branch in the checkout dialog

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Apr 4, 2009, 11:55 UTC
Message-ID
<1238846125-30149-1-git-send-email-robin.rosenberg@dewire.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
 .../ui/internal/dialogs/BranchSelectionDialog.java |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/dialogs/BranchSelectionDialog.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/dialogs/BranchSelectionDialog.java
index cbbc384..1866086 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/dialogs/BranchSelectionDialog.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/dialogs/BranchSelectionDialog.java
@@ -150,6 +150,7 @@ private void fillTreeWithBranches(String select) throws IOException {
 		TreeItem curSubItem = null;
 		String curPrefix = null;
 		String curSubPrefix = null;
+		TreeItem itemToSelect = null;
 
 		for (String ref : branches) {
 			String shortName = ref;
@@ -217,7 +218,12 @@ public void widgetDisposed(DisposeEvent e) {
 			}
 			else item.setText(shortName);
 			if (ref.equals(select))
-				branchTree.select(item);
+				itemToSelect = item;
+			branchTree.setLinesVisible(true);
+		}
+		if (itemToSelect != null) {
+			branchTree.select(itemToSelect);
+			branchTree.showItem(itemToSelect);
 		}
 	}
 
-- 
1.6.2.1.345.g89fb
Message 1 of 1 in “Select and show a newly created branch in the checkout dialog”
  1. Select and show a newly created branch in the checkout dialogRobin Rosenberg, Apr 4, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.