pre-push hook implementation. The pre-push hook runs during
git push, after the remote refs have been updated but before any objects have
been transferred.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| public static final String | NAME
Constant indicating the name of the pre-push hook. |
| private String | |
| private String | |
| private String |
| Access | Constructor and Description |
|---|---|
| protected | PrePushHook(Repository
The repository repo, PrintStream The output stream the hook must use. outputStream)null is allowed,
in which case the hook will use System.out.Constructor for PrePushHook This constructor will use the default error stream. |
| protected | PrePushHook(Repository
The repository repo, PrintStream The output stream the hook must use. outputStream, PrintStream null is allowed,
in which case the hook will use System.out.The error stream the hook must use. errorStream)null is allowed,
in which case the hook will use System.err.Constructor for PrePushHook |
| Modifier and Type | Method and Description |
|---|---|
| public String | call()
Implements abstract org. Implements java. Computes a result, or throws an exception if unable to do so. |
| private boolean | |
| public String | |
| protected String[] | getParameters()
Overrides org. Override this method when needed to provide relevant parameters to the underlying hook script. |
| protected String | |
| protected String | getStdinArgs()
Overrides org. Override to provide relevant arguments via stdin to the underlying hook script. |
| protected boolean | Returns: true if the push is a dry run, false otherwiseTells whether the push is a dry run. |
| public void | setDryRun(boolean
true if the push is a dry run, false otherwiseSets whether the push is a dry run. |
| public void | |
| public void | |
| public void |
| dryRun | back to summary |
|---|---|
| private boolean dryRun | |
| NAME | back to summary |
|---|---|
| public static final String NAME Constant indicating the name of the pre-push hook. | |
| refs | back to summary |
|---|---|
| private String refs | |
| remoteLocation | back to summary |
|---|---|
| private String remoteLocation | |
| remoteName | back to summary |
|---|---|
| private String remoteName | |
| PrePushHook | back to summary |
|---|---|
| protected PrePushHook(Repository repo, PrintStream outputStream) Constructor for PrePushHook This constructor will use the default error stream.
| |
| PrePushHook | back to summary |
|---|---|
| protected PrePushHook(Repository repo, PrintStream outputStream, PrintStream errorStream) Constructor for PrePushHook
| |
| call | back to summary |
|---|---|
| public String call() throws IOException, AbortedByHookException Implements abstract org. Implements java. Doc from org. Computes a result, or throws an exception if unable to do so. Run the hook.
| |
| canRun | back to summary |
|---|---|
private boolean canRun()
| |
| getHookName | back to summary |
|---|---|
| public String getHookName() Implements abstract org. Doc from org. Get name of the hook | |
| getParameters | back to summary |
|---|---|
| protected String[] getParameters() Overrides org. Doc from org. Override this method when needed to provide relevant parameters to the underlying hook script. The default implementation returns an empty array. This hook receives two parameters, which is the name and the location of the remote repository. | |
| getRemoteName | back to summary |
|---|---|
| protected String getRemoteName() Get remote name
| |
| getStdinArgs | back to summary |
|---|---|
| protected String getStdinArgs() Overrides org. Doc from org. Override to provide relevant arguments via stdin to the underlying hook
script. The default implementation returns | |
| isDryRun | back to summary |
|---|---|
| protected boolean isDryRun() Tells whether the push is a dry run.
| |
| setDryRun | back to summary |
|---|---|
| public void setDryRun(boolean dryRun) Sets whether the push is a dry run.
| |
| setRefs | back to summary |
|---|---|
| public void setRefs(Collection<RemoteRefUpdate> toRefs) Set Refs
| |
| setRemoteLocation | back to summary |
|---|---|
| public void setRemoteLocation(String location) Set remote location
| |
| setRemoteName | back to summary |
|---|---|
| public void setRemoteName(String name) Set remote name
| |