setCallable(false); return resultRefs;
public List<Ref> call() throws GitAPIException { checkCallable(); List<Ref> resultRefs; try { Collection<Ref> refs = new ArrayList<Ref>(); // Also return HEAD if it's detached Ref head = repo.exactRef(Constants.HEAD); if (head != null && head.getLeaf().getName().equals(Constants.HEAD)) refs.add(head); if (listMode == null) { refs.addAll(getRefs(Constants.R_HEADS)); } else if (listMode == ListMode.REMOTE) { refs.addAll(getRefs(Constants.R_REMOTES)); } else { refs.addAll(getRefs(Constants.R_HEADS)); refs.addAll(getRefs(Constants.R_REMOTES)); } resultRefs = new ArrayList<Ref>(filterRefs(refs)); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } Collections.sort(resultRefs, new Comparator<Ref>() { public int compare(Ref o1, Ref o2) { return o1.getName().compareTo(o2.getName()); } }); setCallable(false); return resultRefs; }
setCallable(false); return resultRefs;