Browse Source

Merge "Remove unused availableRefs local from Clone.guessHEAD"

stable-3.0
Robin Rosenberg 12 years ago committed by Gerrit Code Review @ Eclipse.org
parent
commit
c0cfcc76e0
  1. 3
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java

3
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java

@ -152,19 +152,16 @@ class Clone extends AbstractFetchCommand {
private static Ref guessHEAD(final FetchResult result) { private static Ref guessHEAD(final FetchResult result) {
final Ref idHEAD = result.getAdvertisedRef(Constants.HEAD); final Ref idHEAD = result.getAdvertisedRef(Constants.HEAD);
final List<Ref> availableRefs = new ArrayList<Ref>();
Ref head = null; Ref head = null;
for (final Ref r : result.getAdvertisedRefs()) { for (final Ref r : result.getAdvertisedRefs()) {
final String n = r.getName(); final String n = r.getName();
if (!n.startsWith(Constants.R_HEADS)) if (!n.startsWith(Constants.R_HEADS))
continue; continue;
availableRefs.add(r);
if (idHEAD == null || head != null) if (idHEAD == null || head != null)
continue; continue;
if (r.getObjectId().equals(idHEAD.getObjectId())) if (r.getObjectId().equals(idHEAD.getObjectId()))
head = r; head = r;
} }
Collections.sort(availableRefs, RefComparator.INSTANCE);
if (idHEAD != null && head == null) if (idHEAD != null && head == null)
head = idHEAD; head = idHEAD;
return head; return head;

Loading…
Cancel
Save