Package com.google.gerrit.server.update
Interface RepoContext
- All Superinterfaces:
Context
Context for performing the
RepoOnlyOp.updateRepo(com.google.gerrit.server.update.RepoContext)
phase.-
Method Summary
Modifier and TypeMethodDescriptiondefault void
addRefUpdate
(org.eclipse.jgit.lib.ObjectId oldId, org.eclipse.jgit.lib.ObjectId newId, String refName) Add a command to the pending list of commands.void
addRefUpdate
(org.eclipse.jgit.transport.ReceiveCommand cmd) Add a command to the pending list of commands.org.eclipse.jgit.lib.ObjectInserter
Returns inserter for writing to the repo.Methods inherited from interface com.google.gerrit.server.update.Context
getAccount, getAccountId, getIdentifiedUser, getNotify, getProject, getRepoView, getRevWalk, getUser, getWhen, getZoneId, newCommitterIdent, newCommitterIdent, newCommitterIdent, newPersonIdent
-
Method Details
-
getInserter
Returns inserter for writing to the repo. Callers should not flush; the walk returned byContext.getRevWalk()
is able to read back objects inserted by this inserter without flushing first.- Throws:
IOException
- if an error occurred opening the repo.
-
addRefUpdate
Add a command to the pending list of commands.Adding commands to the
RepoContext
is the only way of updating refs in the repository from aBatchUpdateOp
.- Parameters:
cmd
- ref update command.- Throws:
IOException
- if an error occurred opening the repo.
-
addRefUpdate
default void addRefUpdate(org.eclipse.jgit.lib.ObjectId oldId, org.eclipse.jgit.lib.ObjectId newId, String refName) throws IOException Add a command to the pending list of commands.Adding commands to the
RepoContext
is the only way of updating refs in the repository from aBatchUpdateOp
.- Parameters:
oldId
- the old object ID; must not be null. UseObjectId.zeroId()
for ref creation.newId
- the new object ID; must not be null. UseObjectId.zeroId()
for ref deletion.refName
- the ref name.- Throws:
IOException
- if an error occurred opening the repo.
-