git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [EGIT PATCH 1/2] Make Git property page cope with empty repositories and not yet born branches
@ 2009-04-08 15:49 Robin Rosenberg
  2009-04-08 15:49 ` [EGIT PATCH 2/2] Externalize strings in GitPropertyPage Robin Rosenberg
  0 siblings, 1 reply; 2+ messages in thread
From: Robin Rosenberg @ 2009-04-08 15:49 UTC (permalink / raw)
  To: spearce; +Cc: git, Robin Rosenberg

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-08 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-08 15:49 [EGIT PATCH 1/2] Make Git property page cope with empty repositories and not yet born branches Robin Rosenberg
2009-04-08 15:49 ` [EGIT PATCH 2/2] Externalize strings in GitPropertyPage Robin Rosenberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).