From aaba376c6a8225850e50c2dc66d707db6a26136b Mon Sep 17 00:00:00 2001 From: Robin Rosenberg Date: Sun, 2 Sep 2007 23:27:44 +0200 Subject: [PATCH] Get rid of the bogus "deprecated" labeling of projects Signed-off-by: Robin Rosenberg --- .../egit/core/project/RepositoryMapping.java | 9 +++-- .../internal/decorators/GitResourceDecorator.java | 47 ++++++++++++---------- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java b/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java index 474f11ee..b062a299 100644 --- a/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java +++ b/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java @@ -201,9 +201,12 @@ public class RepositoryMapping { String prefix = getSubset(); String projectRelativePath = rsrc.getProjectRelativePath().toString(); String repoRelativePath; - if (prefix != null) - repoRelativePath = prefix + "/" + projectRelativePath; - else + if (prefix != null) { + if (projectRelativePath.length() == 0) + repoRelativePath = prefix; + else + repoRelativePath = prefix + "/" + projectRelativePath; + } else repoRelativePath = projectRelativePath; return repoRelativePath; } diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java index 4e292e8c..ead8cc80 100644 --- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java +++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java @@ -228,24 +228,6 @@ public class GitResourceDecorator extends LabelProvider implements Activator.trace("decorate: " + element); - if (mapped != null && rsrc instanceof IProject) { - Repository repo = mapped.getRepository(); - try { - String branch = repo.getBranch(); - if (repo.isStGitMode()) { - String patch = repo.getPatch(); - decoration.addSuffix(" [StGit " + patch + "@" + branch - + "]"); - } else { - decoration.addSuffix(" [Git @ " + branch + "]"); - } - } catch (IOException e) { - e.printStackTrace(); - decoration.addSuffix(" [Git ?]"); - } - decoration.addOverlay(UIIcons.OVR_SHARED); - } - // TODO: How do I see a renamed resource? // TODO: Even trickier: when a path change from being blob to tree? try { @@ -275,6 +257,25 @@ public class GitResourceDecorator extends LabelProvider implements } else { decoration.addSuffix(" ?* "); } + + if (rsrc instanceof IProject) { + Repository repo = mapped.getRepository(); + try { + String branch = repo.getBranch(); + if (repo.isStGitMode()) { + String patch = repo.getPatch(); + decoration.addSuffix(" [StGit " + patch + "@" + branch + + "]"); + } else { + decoration.addSuffix(" [Git @ " + branch + "]"); + } + } catch (IOException e) { + e.printStackTrace(); + decoration.addSuffix(" [Git ?]"); + } + decoration.addOverlay(UIIcons.OVR_SHARED); + } + } else { if (rsrc.getType() == IResource.FILE && Team.isIgnored((IFile) rsrc)) { @@ -286,10 +287,12 @@ public class GitResourceDecorator extends LabelProvider implements } } } else { - decoration.addSuffix("(deprecated)"); // Will drop on - // commit - decoration.addOverlay(UIIcons.OVR_PENDING_REMOVE); - orState(rsrc.getParent(), CHANGED); + if (!(rsrc instanceof IContainer)) { + decoration.addSuffix("(deprecated)"); // Will drop on + // commit + decoration.addOverlay(UIIcons.OVR_PENDING_REMOVE); + orState(rsrc.getParent(), CHANGED); + } } } else { if (entry.getStage() != GitIndex.STAGE_0) { -- 2.11.4.GIT