private Collection<Ref> getAllRefs() throws IOException { Collection<Ref> refs = refdb.getRefs(); List<Ref> addl = refdb.getAdditionalRefs(); if (!addl.isEmpty()) { List<Ref> all = new ArrayList<>(refs.size() + addl.size()); all.addAll(refs); // add additional refs which start with refs/ for (Ref r : addl) { if (r.getName().startsWith(Constants.R_REFS)) { all.add(r); } } return all; } return refs; }
/** {@inheritDoc} */ @Override public List<Ref> getAdditionalRefs() throws IOException { Collection<Ref> txnRefs; if (txnNamespace != null) { txnRefs = bootstrap.getRefsByPrefix(txnNamespace); } else { Ref r = bootstrap.exactRef(txnCommitted); if (r != null && r.getObjectId() != null) { txnRefs = Collections.singleton(r); } else { txnRefs = Collections.emptyList(); } } List<Ref> otherRefs = bootstrap.getAdditionalRefs(); List<Ref> all = new ArrayList<>(txnRefs.size() + otherRefs.size()); all.addAll(txnRefs); all.addAll(otherRefs); return all; }
/** * Returns a collection of all refs and additional refs. * * Additional refs which don't start with "refs/" are not returned because * they should not save objects from being garbage collected. Examples for * such references are ORIG_HEAD, MERGE_HEAD, FETCH_HEAD and * CHERRY_PICK_HEAD. * * @return a collection of refs pointing to live objects. * @throws IOException */ private Collection<Ref> getAllRefs() throws IOException { RefDatabase refdb = repo.getRefDatabase(); Collection<Ref> refs = refdb.getRefs(); List<Ref> addl = refdb.getAdditionalRefs(); if (!addl.isEmpty()) { List<Ref> all = new ArrayList<>(refs.size() + addl.size()); all.addAll(refs); // add additional refs which start with refs/ for (Ref r : addl) { checkCancelled(); if (r.getName().startsWith(Constants.R_REFS)) { all.add(r); } } return all; } return refs; }
private Collection<Ref> getAllRefs() throws IOException { Collection<Ref> refs = refdb.getRefs(RefDatabase.ALL).values(); List<Ref> addl = refdb.getAdditionalRefs(); if (!addl.isEmpty()) { List<Ref> all = new ArrayList<>(refs.size() + addl.size()); all.addAll(refs); // add additional refs which start with refs/ for (Ref r : addl) { if (r.getName().startsWith(Constants.R_REFS)) { all.add(r); } } return all; } return refs; }
private Collection<Ref> getAllRefs() throws IOException { Collection<Ref> refs = refdb.getRefs(); List<Ref> addl = refdb.getAdditionalRefs(); if (!addl.isEmpty()) { List<Ref> all = new ArrayList<>(refs.size() + addl.size()); all.addAll(refs); // add additional refs which start with refs/ for (Ref r : addl) { if (r.getName().startsWith(Constants.R_REFS)) { all.add(r); } } return all; } return refs; }
/** {@inheritDoc} */ @Override public List<Ref> getAdditionalRefs() throws IOException { Collection<Ref> txnRefs; if (txnNamespace != null) { txnRefs = bootstrap.getRefsByPrefix(txnNamespace); } else { Ref r = bootstrap.exactRef(txnCommitted); if (r != null && r.getObjectId() != null) { txnRefs = Collections.singleton(r); } else { txnRefs = Collections.emptyList(); } } List<Ref> otherRefs = bootstrap.getAdditionalRefs(); List<Ref> all = new ArrayList<>(txnRefs.size() + otherRefs.size()); all.addAll(txnRefs); all.addAll(otherRefs); return all; }
@Override public List<Ref> getAdditionalRefs() throws IOException { Collection<Ref> txnRefs; if (txnNamespace != null) { txnRefs = bootstrap.getRefs(txnNamespace).values(); } else { Ref r = bootstrap.exactRef(txnCommitted); if (r != null && r.getObjectId() != null) { txnRefs = Collections.singleton(r); } else { txnRefs = Collections.emptyList(); } } List<Ref> otherRefs = bootstrap.getAdditionalRefs(); List<Ref> all = new ArrayList<>(txnRefs.size() + otherRefs.size()); all.addAll(txnRefs); all.addAll(otherRefs); return all; }
@Override protected CellEditor getCellEditor(Object element) { Repository repo = (Repository) element; List<String> refs = new LinkedList<String>(repo.getAllRefs() .keySet()); List<Ref> additionalRefs; try { additionalRefs = repo.getRefDatabase().getAdditionalRefs(); } catch (IOException e) { additionalRefs = null; } if (additionalRefs != null) for (Ref ref : additionalRefs) refs.add(ref.getName()); Collections.sort(refs, CommonUtils.STRING_ASCENDING_COMPARATOR); branchesEditor.setItems(refs.toArray(new String[refs.size()])); return branchesEditor; }
/** * Returns a collection of all refs and additional refs. * * Additional refs which don't start with "refs/" are not returned because * they should not save objects from being garbage collected. Examples for * such references are ORIG_HEAD, MERGE_HEAD, FETCH_HEAD and * CHERRY_PICK_HEAD. * * @return a collection of refs pointing to live objects. * @throws IOException */ private Collection<Ref> getAllRefs() throws IOException { RefDatabase refdb = repo.getRefDatabase(); Collection<Ref> refs = refdb.getRefs(RefDatabase.ALL).values(); List<Ref> addl = refdb.getAdditionalRefs(); if (!addl.isEmpty()) { List<Ref> all = new ArrayList<>(refs.size() + addl.size()); all.addAll(refs); // add additional refs which start with refs/ for (Ref r : addl) { if (r.getName().startsWith(Constants.R_REFS)) { all.add(r); } } return all; } return refs; }
/** * Returns a collection of all refs and additional refs. * * Additional refs which don't start with "refs/" are not returned because * they should not save objects from being garbage collected. Examples for * such references are ORIG_HEAD, MERGE_HEAD, FETCH_HEAD and * CHERRY_PICK_HEAD. * * @return a collection of refs pointing to live objects. * @throws IOException */ private Collection<Ref> getAllRefs() throws IOException { RefDatabase refdb = repo.getRefDatabase(); Collection<Ref> refs = refdb.getRefs(); List<Ref> addl = refdb.getAdditionalRefs(); if (!addl.isEmpty()) { List<Ref> all = new ArrayList<>(refs.size() + addl.size()); all.addAll(refs); // add additional refs which start with refs/ for (Ref r : addl) { checkCancelled(); if (r.getName().startsWith(Constants.R_REFS)) { all.add(r); } } return all; } return refs; }
private void markStartAdditionalRefs(RevWalk walk) throws IOException { List<Ref> additionalRefs = input.getRepository().getRefDatabase() .getAdditionalRefs(); for (Ref ref : additionalRefs) markStartRef(walk, ref); }
RefDatabase refDatabase = repo.getRefDatabase(); try { refs.addAll(refDatabase.getAdditionalRefs()); } catch (IOException e) {
private SWTWalk createNewWalk(Repository db, AnyObjectId headId) { currentHeadId = headId; SWTWalk walk = new SWTWalk(db); try { if (store .getBoolean(UIPreferences.RESOURCEHISTORY_SHOW_ADDITIONAL_REFS)) walk.addAdditionalRefs(db.getRefDatabase() .getAdditionalRefs()); walk.addAdditionalRefs(db.getRefDatabase() .getRefs(Constants.R_NOTES).values()); } catch (IOException e) { throw new IllegalStateException(NLS.bind( UIText.GitHistoryPage_errorReadingAdditionalRefs, Activator .getDefault().getRepositoryUtil() .getRepositoryName(db)), e); } walk.sort(RevSort.COMMIT_TIME_DESC, true); walk.sort(RevSort.BOUNDARY, true); walk.setRetainBody(false); return walk; }
.getValue())); for (Ref r : repo.getRefDatabase().getAdditionalRefs()) refs.add(new AdditionalRefNode(node, repo, r)); } catch (Exception e) {
RefDatabase refDatabase = myRepository.getRefDatabase(); try { for (Ref ref : refDatabase.getAdditionalRefs()) refs.add(ref.getName());