| Modifier and Type | Field and Description |
|---|---|
static String |
NAME
The post-commit hook name.
|
protected PrintStream |
outputStream
The output stream to be used by the hook.
|
| Modifier | Constructor and Description |
|---|---|
protected |
PostCommitHook(Repository repo,
PrintStream outputStream) |
| Modifier and Type | Method and Description |
|---|---|
Void |
call()
Run the hook.
|
protected void |
doRun()
Runs the hook, without performing any validity checks.
|
String |
getHookName() |
protected PrintStream |
getOutputStream() |
protected String[] |
getParameters()
Override this method when needed to provide relevant parameters to the
underlying hook script.
|
protected Repository |
getRepository() |
protected String |
getStdinArgs()
Override to provide relevant arguments via stdin to the underlying hook
script.
|
public static final String NAME
protected final PrintStream outputStream
protected PostCommitHook(Repository repo, PrintStream outputStream)
repo - The repositoryoutputStream - The output stream the hook must use. null is allowed,
in which case the hook will use System.out.public Void call() throws IOException, AbortedByHookException
call in interface Callable<Void>IOException - if IO goes wrong.AbortedByHookException - If the hook has been run and a returned an exit code
different from zero.public String getHookName()
null.protected Repository getRepository()
protected String[] getParameters()
protected String getStdinArgs()
null.protected PrintStream getOutputStream()
null,
System.out is returned by default.protected void doRun()
throws AbortedByHookException
AbortedByHookException - If the underlying hook script exited with non-zero.Copyright © 2017 Eclipse JGit Project. All rights reserved.