summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorDaniel Megert2012-01-12 07:24:41 (EST)
committer Daniel Megert2012-01-12 07:24:41 (EST)
commit5bc0ecfc2b74ea28ce0d582392b63dbe02ce7429 (patch)
tree2e65cf316f8f0ad15b9f415239b2c9dc2f29ddc5
parent0ea235667ae83e74b5360fa4241279153ce432ea (diff)
downloadegit-5bc0ecfc2b74ea28ce0d582392b63dbe02ce7429.zip
egit-5bc0ecfc2b74ea28ce0d582392b63dbe02ce7429.tar.gz
egit-5bc0ecfc2b74ea28ce0d582392b63dbe02ce7429.tar.bz2
Ensure that 'master' is used if HEAD points to it.refs/changes/29/4929/2
Bug 368029 Change-Id: I995ef7f0f98d06e8e319131b7053f4221c702d99 Signed-off-by: Daniel Megert <daniel_megert@ch.ibm.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/SourceBranchPage.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/SourceBranchPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/SourceBranchPage.java
index c819eef..879cb6d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/SourceBranchPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/SourceBranchPage.java
@@ -4,6 +4,7 @@
* Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>
* Copyright (C) 2010, Mathias Kinzler <mathias.kinzler@sap.com>
* Copyright (c) 2010, Benjamin Muskalla <bmuskalla@eclipsesource.com>
+ * Copyright (c) 2012, IBM Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -342,15 +343,20 @@ class SourceBranchPage extends WizardPage {
final Ref idHEAD = listRemoteOp.getRemoteRef(Constants.HEAD);
head = null;
+ boolean headIsMaster = false;
+ final String masterBranchRef = Constants.R_HEADS + Constants.MASTER;
for (final Ref r : listRemoteOp.getRemoteRefs()) {
final String n = r.getName();
if (!n.startsWith(Constants.R_HEADS))
continue;
availableRefs.add(r);
- if (idHEAD == null || head != null)
+ if (idHEAD == null || headIsMaster)
continue;
- if (r.getObjectId().equals(idHEAD.getObjectId()))
- head = r;
+ if (r.getObjectId().equals(idHEAD.getObjectId())) {
+ headIsMaster = masterBranchRef.equals(r.getName());
+ if (head == null || headIsMaster)
+ head = r;
+ }
}
Collections.sort(availableRefs, new Comparator<Ref>() {
public int compare(final Ref o1, final Ref o2) {