Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ensure that 'master' is used if HEAD points to it.

Bug 368029
Change-Id: I995ef7f0f98d06e8e319131b7053f4221c702d99
Signed-off-by: Daniel Megert <daniel_megert@ch.ibm.com>
  • Loading branch information...
commit 5bc0ecfc2b74ea28ce0d582392b63dbe02ce7429 1 parent 0ea2356
Daniel Megert authored
View
12 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 @@ public void run(IProgressMonitor monitor)
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) {
Please sign in to comment.
Something went wrong with that request. Please try again.