Class PatchIdDiffFormatter

java.lang.Object
org.eclipse.jgit.diff.DiffFormatter
org.eclipse.jgit.diff.PatchIdDiffFormatter
All Implemented Interfaces:
AutoCloseable

public class PatchIdDiffFormatter extends DiffFormatter
A DiffFormatter used to calculate the patch-id of the diff.
  • Field Details

  • Constructor Details

    • PatchIdDiffFormatter

      public PatchIdDiffFormatter()
      Initialize a formatter to compute a patch id.
  • Method Details

    • getCalulatedPatchId

      public ObjectId getCalulatedPatchId()
      Should be called after having called one of the format methods
      Returns:
      the patch id calculated for the provided diff.
    • writeHunkHeader

      protected void writeHunkHeader(int aStartLine, int aEndLine, int bStartLine, int bEndLine) throws IOException
      Output a hunk header
      Overrides:
      writeHunkHeader in class DiffFormatter
      Parameters:
      aStartLine - within first source
      aEndLine - within first source
      bStartLine - within second source
      bEndLine - within second source
      Throws:
      IOException
    • formatIndexLine

      protected void formatIndexLine(OutputStream o, DiffEntry ent) throws IOException
      Format index line
      Overrides:
      formatIndexLine in class DiffFormatter
      Parameters:
      o - the stream the formatter will write line data to
      ent - the DiffEntry to create the FileHeader for
      Throws:
      IOException - writing to the supplied stream failed.