pre-commit
hook implementation. This hook is run before the
* commit and can reject the commit.
*
* @since 4.0
*/
public class PreCommitHook extends GitHook* This constructor will use the default error stream. *
* * @param repo * The repository * @param outputStream * The output stream the hook must use. {@code null} is allowed, * in which case the hook will use {@code System.out}. */ protected PreCommitHook(Repository repo, PrintStream outputStream) { super(repo, outputStream); } /** * Constructor for PreCommitHook * * @param repo * The repository * @param outputStream * The output stream the hook must use. {@code null} is allowed, * in which case the hook will use {@code System.out}. * @param errorStream * The error stream the hook must use. {@code null} is allowed, * in which case the hook will use {@code System.err}. * @since 5.6 */ protected PreCommitHook(Repository repo, PrintStream outputStream, PrintStream errorStream) { super(repo, outputStream, errorStream); } /** {@inheritDoc} */ @Override public Void call() throws IOException, AbortedByHookException { doRun(); return null; } /** {@inheritDoc} */ @Override public String getHookName() { return NAME; } }