List of usage examples for org.eclipse.jgit.api ShowNoteCommand setObjectId
public ShowNoteCommand setObjectId(RevObject id)
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. *//*from ww w . j a va2 s .co m*/ 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); } }