Package com.google.gerrit.server.git
Class NotesBranchUtil
- java.lang.Object
- 
- com.google.gerrit.server.git.NotesBranchUtil
 
- 
 public class NotesBranchUtil extends Object A utility class for updating a notes branch with automatic merge of note trees.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static interfaceNotesBranchUtil.Factory
 - 
Constructor SummaryConstructors Constructor Description NotesBranchUtil(org.eclipse.jgit.lib.PersonIdent gerritIdent, GitReferenceUpdated gitRefUpdated, Project.NameKey project, org.eclipse.jgit.lib.Repository db, org.eclipse.jgit.lib.ObjectInserter inserter)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommitAllNotes(org.eclipse.jgit.notes.NoteMap notes, String notesBranch, org.eclipse.jgit.lib.PersonIdent commitAuthor, String commitMessage)Create a new commit in thenotesBranchby updating existing or creating new notes from thenotesmap.org.eclipse.jgit.notes.NoteMapcommitNewNotes(org.eclipse.jgit.notes.NoteMap notes, String notesBranch, org.eclipse.jgit.lib.PersonIdent commitAuthor, String commitMessage)Create a new commit in thenotesBranchby creating not yet existing notes from thenotesmap.
 
- 
- 
- 
Constructor Detail- 
NotesBranchUtil@Inject public NotesBranchUtil(org.eclipse.jgit.lib.PersonIdent gerritIdent, GitReferenceUpdated gitRefUpdated, Project.NameKey project, org.eclipse.jgit.lib.Repository db, org.eclipse.jgit.lib.ObjectInserter inserter)
 
- 
 - 
Method Detail- 
commitAllNotespublic final void commitAllNotes(org.eclipse.jgit.notes.NoteMap notes, String notesBranch, org.eclipse.jgit.lib.PersonIdent commitAuthor, String commitMessage) throws IOExceptionCreate a new commit in thenotesBranchby updating existing or creating new notes from thenotesmap.Does not retry in the case of lock failure; callers may use RetryHelper.- Parameters:
- notes- map of notes
- notesBranch- notes branch to update
- commitAuthor- author of the commit in the notes branch
- commitMessage- for the commit in the notes branch
- Throws:
- com.google.gerrit.git.LockFailureException- if committing the notes failed due to a lock failure on the notes branch
- IOException- if committing the notes failed for any other reason
 
 - 
commitNewNotespublic final org.eclipse.jgit.notes.NoteMap commitNewNotes(org.eclipse.jgit.notes.NoteMap notes, String notesBranch, org.eclipse.jgit.lib.PersonIdent commitAuthor, String commitMessage) throws IOExceptionCreate a new commit in thenotesBranchby creating not yet existing notes from thenotesmap. The notes from thenotesmap which already exist in the note-tree of the tip of thenotesBranchwill not be updated.Does not retry in the case of lock failure; callers may use RetryHelper.- Parameters:
- notes- map of notes
- notesBranch- notes branch to update
- commitAuthor- author of the commit in the notes branch
- commitMessage- for the commit in the notes branch
- Returns:
- map with those notes from the notesthat were newly created
- Throws:
- com.google.gerrit.git.LockFailureException- if committing the notes failed due to a lock failure on the notes branch
- IOException- if committing the notes failed for any other reason
 
 
- 
 
-