List of usage examples for org.eclipse.jgit.api ListNotesCommand call
@Override public List<Note> call() throws GitAPIException
From source file:com.google.appraise.eclipse.core.client.git.AppraiseGitReviewClient.java
License:Open Source License
/** * Retrieves all the reviews in the current project's repository by commit hash. *//*from w w w . java 2 s . co m*/ public Map<String, Review> listReviews() throws GitClientException { // Get the most up-to-date list of reviews. syncCommentsAndReviews(); Map<String, Review> reviews = new LinkedHashMap<>(); Git git = new Git(repo); try { ListNotesCommand cmd = git.notesList(); cmd.setNotesRef(REVIEWS_REF); List<Note> notes = cmd.call(); for (Note note : notes) { String rawNoteDataStr = noteToString(repo, note); Review latest = extractLatestReviewFromNotes(rawNoteDataStr); if (latest != null) { reviews.put(note.getName(), latest); } } } catch (Exception e) { throw new GitClientException(e); } finally { git.close(); } return reviews; }