Class PreCommitHook

java.lang.Object
org.eclipse.jgit.hooks.GitHook<Void>
org.eclipse.jgit.hooks.PreCommitHook
All Implemented Interfaces:
Callable<Void>

public class PreCommitHook extends GitHook<Void>
The pre-commit hook implementation. This hook is run before the commit and can reject the commit.
Since:
4.0
  • Field Details

  • Constructor Details

    • PreCommitHook

      protected PreCommitHook(Repository repo, PrintStream outputStream)
      Constructor for PreCommitHook

      This constructor will use the default error stream.

      Parameters:
      repo - The repository
      outputStream - The output stream the hook must use. null is allowed, in which case the hook will use System.out.
    • PreCommitHook

      protected PreCommitHook(Repository repo, PrintStream outputStream, PrintStream errorStream)
      Constructor for PreCommitHook
      Parameters:
      repo - The repository
      outputStream - The output stream the hook must use. null is allowed, in which case the hook will use System.out.
      errorStream - The error stream the hook must use. null is allowed, in which case the hook will use System.err.
      Since:
      5.6
  • Method Details