summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorKevin Sawicki2011-04-18 17:13:32 (EDT)
committer Matthias Sohn2011-04-19 02:56:14 (EDT)
commitcb29c9daa4347df198495ad8ef2fcc4dcdd4a50a (patch)
tree4117a3b97e72e369fdecddb7ccd10b7604305360
parentf9aa66978f4a930ee8149f74ec2ac4ee33cc8a39 (diff)
downloadegit-cb29c9daa4347df198495ad8ef2fcc4dcdd4a50a.zip
egit-cb29c9daa4347df198495ad8ef2fcc4dcdd4a50a.tar.gz
egit-cb29c9daa4347df198495ad8ef2fcc4dcdd4a50a.tar.bz2
[repoView] Use directory name as label for bare repositoriesrefs/changes/52/3152/2
Bug: 336946 Change-Id: I911831df505c924f20bfaf1e53dafc7590bd26a9 Signed-off-by: Kevin Sawicki <kevin@github.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewLabelProvider.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewLabelProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewLabelProvider.java
index e834b9b..41e83e1 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewLabelProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewLabelProvider.java
@@ -221,8 +221,11 @@ public class RepositoriesViewLabelProvider extends LabelProvider implements
case REPO:
Repository repository = (Repository) node.getObject();
File directory = repository.getDirectory();
- StyledString string = new StyledString(directory
- .getParentFile().getName());
+ StyledString string = new StyledString();
+ if (!repository.isBare())
+ string.append(directory.getParentFile().getName());
+ else
+ string.append(directory.getName());
string
.append(
" - " + directory.getAbsolutePath(), StyledString.QUALIFIER_STYLER); //$NON-NLS-1$