diff options
author | Jonathan Nieder <jrn@google.com> | 2013-02-12 16:29:24 -0800 |
---|---|---|
committer | Jonathan Nieder <jrn@google.com> | 2013-02-12 16:29:24 -0800 |
commit | cb349da0174e77cc751e6cb8a16b327c4976b993 (patch) | |
tree | 51beb2015a0dcea78094e80ca4b5d32475cc596d | |
parent | 51d0e1f26e23d04ae73054958546159e01196a4d (diff) | |
download | jgit-cb349da0174e77cc751e6cb8a16b327c4976b993.tar.gz jgit-cb349da0174e77cc751e6cb8a16b327c4976b993.zip |
Remove unused availableRefs local from Clone.guessHEAD
This variable has been populated and never used ever since it was
introduced in v0.4.9~336 (Add "jgit clone", 2008-12-23). Remove it
to make the function easier to understand.
Change-Id: Idb7eb80bc236a20f7385ad2d6141b4d1c5c3f1cc
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java index 5406527a68..cef46e1f35 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java +++ b/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) { final Ref idHEAD = result.getAdvertisedRef(Constants.HEAD); - final List<Ref> availableRefs = new ArrayList<Ref>(); Ref head = null; for (final Ref r : result.getAdvertisedRefs()) { final String n = r.getName(); if (!n.startsWith(Constants.R_HEADS)) continue; - availableRefs.add(r); if (idHEAD == null || head != null) continue; if (r.getObjectId().equals(idHEAD.getObjectId())) head = r; } - Collections.sort(availableRefs, RefComparator.INSTANCE); if (idHEAD != null && head == null) head = idHEAD; return head; |