List of usage examples for org.eclipse.jgit.api ShowNoteCommand setNotesRef
public ShowNoteCommand setNotesRef(String notesRef)
From source file:com.google.appraise.eclipse.core.client.git.AppraiseGitReviewClient.java
License:Open Source License
/** * Reads a single note out as a string from the given commit hash. * Returns null if the note isn't found. *//* w ww . ja v a 2 s . com*/ private String readOneNote(Git git, String notesRef, String hash) throws GitClientException { try (RevWalk walker = new RevWalk(git.getRepository())) { ShowNoteCommand cmd = git.notesShow(); cmd.setNotesRef(notesRef); ObjectId ref = git.getRepository().resolve(hash); RevCommit commit = walker.parseCommit(ref); cmd.setObjectId(commit); Note note = cmd.call(); if (note == null) { return null; } return noteToString(repo, note); } catch (Exception e) { throw new GitClientException(e); } }