| Modifier and Type | Field and Description |
|---|---|
static String |
NAME
Constant indicating the name of the pre-push hook.
|
| Modifier | Constructor and Description |
|---|---|
protected |
PrePushHook(Repository repo,
PrintStream outputStream)
Constructor for PrePushHook
|
protected |
PrePushHook(Repository repo,
PrintStream outputStream,
PrintStream errorStream)
Constructor for PrePushHook
|
| Modifier and Type | Method and Description |
|---|---|
String |
call() |
String |
getHookName()
Get name of the hook
|
protected String[] |
getParameters()
Override this method when needed to provide relevant parameters to the
underlying hook script.
|
protected String |
getRemoteName()
Get remote name
|
protected String |
getStdinArgs()
Override to provide relevant arguments via stdin to the underlying hook
script.
|
void |
setRefs(Collection<RemoteRefUpdate> toRefs)
Set Refs
|
void |
setRemoteLocation(String location)
Set remote location
|
void |
setRemoteName(String name)
Set remote name
|
doRun, getErrorStream, getOutputStream, getRepository, handleError, isNativeHookPresentpublic static final String NAME
protected PrePushHook(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 PrePushHook(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.protected String getStdinArgs()
null.getStdinArgs in class GitHook<String>public String call() throws IOException, AbortedByHookException
Run the hook.
call in interface Callable<String>call in class GitHook<String>IOExceptionAbortedByHookExceptionpublic String getHookName()
getHookName in class GitHook<String>null.protected String[] getParameters()
This hook receives two parameters, which is the name and the location of the remote repository.
getParameters in class GitHook<String>public void setRemoteName(String name)
name - remote nameprotected String getRemoteName()
public void setRemoteLocation(String location)
location - a remote locationpublic void setRefs(Collection<RemoteRefUpdate> toRefs)
toRefs - a collection of RemoteRefUpdatesCopyright © 2021 Eclipse JGit Project. All rights reserved.