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

[EGIT PATCH 1/2] Make Git property page cope with empty repositories and not yet born branches

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Apr 8, 2009, 15:49 UTC
Message-ID
<1239205781-28009-1-git-send-email-robin.rosenberg@dewire.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
 .../preferences/GitProjectPropertyPage.java        |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/preferences/GitProjectPropertyPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/preferences/GitProjectPropertyPage.java
index 4c97cc8..d3afd97 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/preferences/GitProjectPropertyPage.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/preferences/GitProjectPropertyPage.java
@@ -94,7 +94,13 @@ private void fillValues(Repository repository) throws IOException {
 
 		final ObjectId objectId = repository
 				.resolve(repository.getFullBranch());
-		id.setText(objectId.name());
+		if (objectId == null) {
+			if (repository.getAllRefs().size() == 0)
+				id.setText("None (empty repository)");
+			else
+				id.setText("None (unborn branch)");
+		} else
+			id.setText(objectId.name());
 	}
 
 	/**
-- 
1.6.2.2.446.gfbdc0
Next: Robin Rosenberg
Message 1 of 2 in “Make Git property page cope with empty repositories and not yet born branches”
  1. 1/2 Make Git property page cope with empty repositories and not yet born branchesRobin Rosenberg, Apr 8, 2009
  2. 2/2 Externalize strings in GitPropertyPageRobin Rosenberg, Apr 8, 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.