Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Rosenberg2013-04-29 15:11:45 -0400
committerRobin Rosenberg2013-04-29 15:13:18 -0400
commit38d3d84c0d1dea2bc79d0fe5edccf875d1991113 (patch)
treea95b077fac179bfa809226b8a24ffdbbb9689a45
parentc3a6041507f6d32ebef265dca18524d1c2b200ac (diff)
downloadegit-38d3d84c0d1dea2bc79d0fe5edccf875d1991113.tar.gz
egit-38d3d84c0d1dea2bc79d0fe5edccf875d1991113.tar.xz
egit-38d3d84c0d1dea2bc79d0fe5edccf875d1991113.zip
Show the right tag for unannotated tags after checkout
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java
index a1bdbc2fc..afdc113b7 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java
@@ -128,8 +128,12 @@ public class RepositoryUtil {
CheckoutEntry checkoutEntry = entry.parseCheckout();
if (checkoutEntry != null) {
Ref ref = repository.getRef(checkoutEntry.getToBranch());
- if (ref != null)
+ if (ref != null) {
+ if (ref.getObjectId().getName()
+ .equals(commitId))
+ return checkoutEntry.getToBranch();
ref = repository.peel(ref);
+ }
if (ref != null) {
ObjectId id = ref.getPeeledObjectId();
if (id != null && id.getName().equals(commitId))

Back to the top