Interface RepoContext

All Superinterfaces:
Context

public interface RepoContext extends Context
  • Method Details

    • getInserter

      org.eclipse.jgit.lib.ObjectInserter getInserter() throws IOException
      Returns inserter for writing to the repo. Callers should not flush; the walk returned by Context.getRevWalk() is able to read back objects inserted by this inserter without flushing first.
      Throws:
      IOException - if an error occurred opening the repo.
    • addRefUpdate

      void addRefUpdate(org.eclipse.jgit.transport.ReceiveCommand cmd) 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 a BatchUpdateOp.

      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 a BatchUpdateOp.

      Parameters:
      oldId - the old object ID; must not be null. Use ObjectId.zeroId() for ref creation.
      newId - the new object ID; must not be null. Use ObjectId.zeroId() for ref deletion.
      refName - the ref name.
      Throws:
      IOException - if an error occurred opening the repo.