/** {@inheritDoc} */ @Override public List<Note> call() throws GitAPIException { checkCallable(); List<Note> notes = new ArrayList<>(); NoteMap map = NoteMap.newEmptyMap(); try (RevWalk walk = new RevWalk(repo)) { Ref ref = repo.findRef(notesRef); // if we have a notes ref, use it if (ref != null) { RevCommit notesCommit = walk.parseCommit(ref.getObjectId()); map = NoteMap.read(walk.getObjectReader(), notesCommit); } Iterator<Note> i = map.iterator(); while (i.hasNext()) notes.add(i.next()); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } return notes; }
/** * @return the requested notes */ public List<Note> call() throws GitAPIException { checkCallable(); List<Note> notes = new ArrayList<Note>(); NoteMap map = NoteMap.newEmptyMap(); try (RevWalk walk = new RevWalk(repo)) { Ref ref = repo.findRef(notesRef); // if we have a notes ref, use it if (ref != null) { RevCommit notesCommit = walk.parseCommit(ref.getObjectId()); map = NoteMap.read(walk.getObjectReader(), notesCommit); } Iterator<Note> i = map.iterator(); while (i.hasNext()) notes.add(i.next()); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } return notes; }
/** {@inheritDoc} */ @Override public List<Note> call() throws GitAPIException { checkCallable(); List<Note> notes = new ArrayList<>(); NoteMap map = NoteMap.newEmptyMap(); try (RevWalk walk = new RevWalk(repo)) { Ref ref = repo.findRef(notesRef); // if we have a notes ref, use it if (ref != null) { RevCommit notesCommit = walk.parseCommit(ref.getObjectId()); map = NoteMap.read(walk.getObjectReader(), notesCommit); } Iterator<Note> i = map.iterator(); while (i.hasNext()) notes.add(i.next()); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } return notes; }