Modifier and Type | Field and Description |
---|---|
static String |
NAME
The post-commit hook name.
|
Modifier | Constructor and Description |
---|---|
protected |
PostCommitHook(Repository repo,
PrintStream outputStream)
Constructor for PostCommitHook
|
protected |
PostCommitHook(Repository repo,
PrintStream outputStream,
PrintStream errorStream)
Constructor for PostCommitHook
|
Modifier and Type | Method and Description |
---|---|
Void |
call() |
String |
getHookName()
Get name of the hook
|
protected void |
handleError(String message,
ProcessResult result)
Overwrites the default implementation to never throw an
AbortedByHookException , as the commit has already been done and
the exit code of the post-commit hook has no effect. |
doRun, getErrorStream, getOutputStream, getParameters, getRepository, getStdinArgs, isNativeHookPresent
public static final String NAME
protected PostCommitHook(Repository repo, PrintStream outputStream)
This constructor will use the default error stream.
repo
- The repositoryoutputStream
- The output stream the hook must use. null
is allowed,
in which case the hook will use System.out
.protected PostCommitHook(Repository repo, PrintStream outputStream, PrintStream errorStream)
repo
- The repositoryoutputStream
- 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
.public Void call() throws IOException, AbortedByHookException
Run the hook.
call
in interface Callable<Void>
call
in class GitHook<Void>
IOException
AbortedByHookException
public String getHookName()
getHookName
in class GitHook<Void>
null
.protected void handleError(String message, ProcessResult result) throws AbortedByHookException
AbortedByHookException
, as the commit has already been done and
the exit code of the post-commit hook has no effect.handleError
in class GitHook<Void>
message
- error messageresult
- The process result of the hookAbortedByHookException
- When the hook should be abortedCopyright © 2021 Eclipse JGit Project. All rights reserved.