Class 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
    • Constructor Detail

      • 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