Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeWorkbenchAdapter.java20
1 files changed, 9 insertions, 11 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeWorkbenchAdapter.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeWorkbenchAdapter.java
index 479aaec14..598c16381 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeWorkbenchAdapter.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeWorkbenchAdapter.java
@@ -31,8 +31,6 @@ import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.revwalk.RevCommit;
-import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.model.WorkbenchAdapter;
@@ -136,15 +134,15 @@ public class RepositoryTreeNodeWorkbenchAdapter extends WorkbenchAdapter {
TagNode tagNode = (TagNode) node;
compareString = tagNode.getCommitId();
} else if (refName.startsWith(Constants.R_REMOTES)) {
- // remote branch: HEAD would be on the commit id to which
- // the branch is pointing
- ObjectId id = repository.resolve(refName);
- if (id == null) {
- return base;
- }
- try (RevWalk rw = new RevWalk(repository)) {
- RevCommit commit = rw.parseCommit(id);
- compareString = commit.getId().name();
+ // remote branch: branch name is object id in detached HEAD
+ // state
+ ObjectId objectId = leaf.getObjectId();
+ if (objectId != null) {
+ String leafName = objectId.getName();
+ if (leafName.equals(branchName)) {
+ return new DecorationOverlayDescriptor(base,
+ UIIcons.OVR_CHECKEDOUT, IDecoration.TOP_LEFT);
+ }
}
} else if (refName.equals(Constants.HEAD)) {
return new DecorationOverlayDescriptor(base,

Back to the top