- java.lang.Object
-
- org.eclipse.jgit.hooks.GitHook<Void>
-
- org.eclipse.jgit.hooks.PreCommitHook
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPreCommitHook(Repository repo, PrintStream outputStream)Constructor for PreCommitHookprotectedPreCommitHook(Repository repo, PrintStream outputStream, PrintStream errorStream)Constructor for PreCommitHook
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Voidcall()StringgetHookName()Get name of the hook-
Methods inherited from class org.eclipse.jgit.hooks.GitHook
doRun, getErrorStream, getOutputStream, getParameters, getRepository, getStdinArgs, handleError, isNativeHookPresent
-
-
-
-
Field Detail
-
NAME
public static final String NAME
The pre-commit hook name.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PreCommitHook
protected PreCommitHook(Repository repo, PrintStream outputStream)
Constructor for PreCommitHookThis constructor will use the default error stream.
- Parameters:
repo- The repositoryoutputStream- The output stream the hook must use.nullis allowed, in which case the hook will useSystem.out.
-
PreCommitHook
protected PreCommitHook(Repository repo, PrintStream outputStream, PrintStream errorStream)
Constructor for PreCommitHook- Parameters:
repo- The repositoryoutputStream- The output stream the hook must use.nullis allowed, in which case the hook will useSystem.out.errorStream- The error stream the hook must use.nullis allowed, in which case the hook will useSystem.err.- Since:
- 5.6
-
-
Method Detail
-
call
public Void call() throws IOException, AbortedByHookException
Run the hook.
- Specified by:
callin interfaceCallable<Void>- Specified by:
callin classGitHook<Void>- Throws:
IOExceptionAbortedByHookException
-
getHookName
public String getHookName()
Get name of the hook- Specified by:
getHookNamein classGitHook<Void>- Returns:
- The name of the hook, which must not be
null.
-
-