Package org.eclipse.jgit.hooks
Class Hooks
- java.lang.Object
-
- org.eclipse.jgit.hooks.Hooks
-
public class Hooks extends Object
Factory class for instantiating supported hooks.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description Hooks()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CommitMsgHook
commitMsg(Repository repo, PrintStream outputStream)
Create commit-msg hook for the given repository with the default error streamstatic CommitMsgHook
commitMsg(Repository repo, PrintStream outputStream, PrintStream errorStream)
Create commit-msg hook for the given repositorystatic PostCommitHook
postCommit(Repository repo, PrintStream outputStream)
Create post-commit hook for the given repository with the default error streamstatic PostCommitHook
postCommit(Repository repo, PrintStream outputStream, PrintStream errorStream)
Create post-commit hook for the given repositorystatic PreCommitHook
preCommit(Repository repo, PrintStream outputStream)
Create pre-commit hook for the given repository with the default error streamstatic PreCommitHook
preCommit(Repository repo, PrintStream outputStream, PrintStream errorStream)
Create pre-commit hook for the given repositorystatic PrePushHook
prePush(Repository repo, PrintStream outputStream)
Create pre-push hook for the given repository with the default error streamstatic PrePushHook
prePush(Repository repo, PrintStream outputStream, PrintStream errorStream)
Create pre-push hook for the given repository
-
-
-
Method Detail
-
preCommit
public static PreCommitHook preCommit(Repository repo, PrintStream outputStream)
Create pre-commit hook for the given repository with the default error stream- Parameters:
repo
- aRepository
object.outputStream
- The output stream, ornull
to useSystem.out
- Returns:
- The pre-commit hook for the given repository.
-
preCommit
public static PreCommitHook preCommit(Repository repo, PrintStream outputStream, PrintStream errorStream)
Create pre-commit hook for the given repository- Parameters:
repo
- aRepository
object.outputStream
- The output stream, ornull
to useSystem.out
errorStream
- The error stream, ornull
to useSystem.err
- Returns:
- The pre-commit hook for the given repository.
- Since:
- 5.6
-
postCommit
public static PostCommitHook postCommit(Repository repo, PrintStream outputStream)
Create post-commit hook for the given repository with the default error stream- Parameters:
repo
- aRepository
object.outputStream
- The output stream, ornull
to useSystem.out
- Returns:
- The post-commit hook for the given repository.
- Since:
- 4.5
-
postCommit
public static PostCommitHook postCommit(Repository repo, PrintStream outputStream, PrintStream errorStream)
Create post-commit hook for the given repository- Parameters:
repo
- aRepository
object.outputStream
- The output stream, ornull
to useSystem.out
errorStream
- The error stream, ornull
to useSystem.err
- Returns:
- The pre-commit hook for the given repository.
- Since:
- 5.6
-
commitMsg
public static CommitMsgHook commitMsg(Repository repo, PrintStream outputStream)
Create commit-msg hook for the given repository with the default error stream- Parameters:
repo
- aRepository
object.outputStream
- The output stream, ornull
to useSystem.out
- Returns:
- The commit-msg hook for the given repository.
-
commitMsg
public static CommitMsgHook commitMsg(Repository repo, PrintStream outputStream, PrintStream errorStream)
Create commit-msg hook for the given repository- Parameters:
repo
- aRepository
object.outputStream
- The output stream, ornull
to useSystem.out
errorStream
- The error stream, ornull
to useSystem.err
- Returns:
- The pre-commit hook for the given repository.
- Since:
- 5.6
-
prePush
public static PrePushHook prePush(Repository repo, PrintStream outputStream)
Create pre-push hook for the given repository with the default error stream- Parameters:
repo
- aRepository
object.outputStream
- The output stream, ornull
to useSystem.out
- Returns:
- The pre-push hook for the given repository.
- Since:
- 4.2
-
prePush
public static PrePushHook prePush(Repository repo, PrintStream outputStream, PrintStream errorStream)
Create pre-push hook for the given repository- Parameters:
repo
- aRepository
object.outputStream
- The output stream, ornull
to useSystem.out
errorStream
- The error stream, ornull
to useSystem.err
- Returns:
- The pre-push hook for the given repository.
- Since:
- 5.6
-
-