Package org.eclipse.jgit.hooks
Class PostCommitHook
- java.lang.Object
-
- org.eclipse.jgit.hooks.GitHook<java.lang.Void>
-
- org.eclipse.jgit.hooks.PostCommitHook
-
- All Implemented Interfaces:
java.util.concurrent.Callable<java.lang.Void>
public class PostCommitHook extends GitHook<java.lang.Void>
Thepost-commit
hook implementation. This hook is run after the commit was successfully executed.- Since:
- 4.5
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAME
The post-commit hook name.-
Fields inherited from class org.eclipse.jgit.hooks.GitHook
errorStream, outputStream
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PostCommitHook(Repository repo, java.io.PrintStream outputStream)
Constructor for PostCommitHookprotected
PostCommitHook(Repository repo, java.io.PrintStream outputStream, java.io.PrintStream errorStream)
Constructor for PostCommitHook
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Void
call()
java.lang.String
getHookName()
Get name of the hook-
Methods inherited from class org.eclipse.jgit.hooks.GitHook
doRun, getErrorStream, getOutputStream, getParameters, getRepository, getStdinArgs, isNativeHookPresent
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
The post-commit hook name.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PostCommitHook
protected PostCommitHook(Repository repo, java.io.PrintStream outputStream)
Constructor for PostCommitHookThis constructor will use the default error stream.
- Parameters:
repo
- The repositoryoutputStream
- The output stream the hook must use.null
is allowed, in which case the hook will useSystem.out
.
-
PostCommitHook
protected PostCommitHook(Repository repo, java.io.PrintStream outputStream, java.io.PrintStream errorStream)
Constructor for PostCommitHook- Parameters:
repo
- The repositoryoutputStream
- The output stream the hook must use.null
is allowed, in which case the hook will useSystem.out
.errorStream
- The error stream the hook must use.null
is allowed, in which case the hook will useSystem.err
.- Since:
- 5.6
-
-
Method Detail
-
call
public java.lang.Void call() throws java.io.IOException, AbortedByHookException
Run the hook.
- Specified by:
call
in interfacejava.util.concurrent.Callable<java.lang.Void>
- Specified by:
call
in classGitHook<java.lang.Void>
- Throws:
java.io.IOException
AbortedByHookException
-
getHookName
public java.lang.String getHookName()
Get name of the hook- Specified by:
getHookName
in classGitHook<java.lang.Void>
- Returns:
- The name of the hook, which must not be
null
.
-
-