Browse Source

Fix javadoc in org.eclipse.jgit hooks package

Change-Id: I3b644048eb0fc19f94ba8f9799b5a2310481103f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.10
Matthias Sohn 7 years ago
parent
commit
d1804d3f74
  1. 6
      org.eclipse.jgit/src/org/eclipse/jgit/hooks/CommitMsgHook.java
  2. 19
      org.eclipse.jgit/src/org/eclipse/jgit/hooks/GitHook.java
  3. 12
      org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java
  4. 4
      org.eclipse.jgit/src/org/eclipse/jgit/hooks/PostCommitHook.java
  5. 4
      org.eclipse.jgit/src/org/eclipse/jgit/hooks/PreCommitHook.java
  6. 16
      org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java

6
org.eclipse.jgit/src/org/eclipse/jgit/hooks/CommitMsgHook.java

@ -71,6 +71,8 @@ public class CommitMsgHook extends GitHook<String> {
private String commitMessage;
/**
* Constructor for CommitMsgHook
*
* @param repo
* The repository
* @param outputStream
@ -81,6 +83,7 @@ public class CommitMsgHook extends GitHook<String> {
super(repo, outputStream);
}
/** {@inheritDoc} */
@Override
public String call() throws IOException, AbortedByHookException {
if (commitMessage == null) {
@ -103,12 +106,15 @@ public class CommitMsgHook extends GitHook<String> {
return getCommitEditMessageFilePath() != null && commitMessage != null;
}
/** {@inheritDoc} */
@Override
public String getHookName() {
return NAME;
}
/**
* {@inheritDoc}
*
* This hook receives one parameter, which is the path to the file holding
* the current commit-msg, relative to the repository's work tree.
*/

19
org.eclipse.jgit/src/org/eclipse/jgit/hooks/GitHook.java

@ -79,7 +79,10 @@ abstract class GitHook<T> implements Callable<T> {
protected final PrintStream outputStream;
/**
* Constructor for GitHook
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
* @param outputStream
* The output stream the hook must use. {@code null} is allowed,
* in which case the hook will use {@code System.out}.
@ -90,23 +93,23 @@ abstract class GitHook<T> implements Callable<T> {
}
/**
* {@inheritDoc}
* <p>
* Run the hook.
*
* @throws IOException
* if IO goes wrong.
* @throws AbortedByHookException
* If the hook has been run and a returned an exit code
* different from zero.
*/
@Override
public abstract T call() throws IOException, AbortedByHookException;
/**
* Get name of the hook
*
* @return The name of the hook, which must not be {@code null}.
*/
public abstract String getHookName();
/**
* Get the repository
*
* @return The repository.
*/
protected Repository getRepository() {
@ -135,6 +138,8 @@ abstract class GitHook<T> implements Callable<T> {
}
/**
* Get output stream
*
* @return The output stream the hook must use. Never {@code null},
* {@code System.out} is returned by default.
*/
@ -145,7 +150,7 @@ abstract class GitHook<T> implements Callable<T> {
/**
* Runs the hook, without performing any validity checks.
*
* @throws AbortedByHookException
* @throws org.eclipse.jgit.api.errors.AbortedByHookException
* If the underlying hook script exited with non-zero.
*/
protected void doRun() throws AbortedByHookException {

12
org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java

@ -54,7 +54,10 @@ import org.eclipse.jgit.lib.Repository;
public class Hooks {
/**
* Create pre-commit hook for the given repository
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
* @param outputStream
* The output stream, or {@code null} to use {@code System.out}
* @return The pre-commit hook for the given repository.
@ -65,7 +68,10 @@ public class Hooks {
}
/**
* Create post-commit hook for the given repository
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
* @param outputStream
* The output stream, or {@code null} to use {@code System.out}
* @return The post-commit hook for the given repository.
@ -77,7 +83,10 @@ public class Hooks {
}
/**
* Create commit-msg hook for the given repository
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
* @param outputStream
* The output stream, or {@code null} to use {@code System.out}
* @return The commit-msg hook for the given repository.
@ -88,7 +97,10 @@ public class Hooks {
}
/**
* Create pre-push hook for the given repository
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
* @param outputStream
* The output stream, or {@code null} to use {@code System.out}
* @return The pre-push hook for the given repository.

4
org.eclipse.jgit/src/org/eclipse/jgit/hooks/PostCommitHook.java

@ -60,6 +60,8 @@ public class PostCommitHook extends GitHook<Void> {
public static final String NAME = "post-commit"; //$NON-NLS-1$
/**
* Constructor for PostCommitHook
*
* @param repo
* The repository
* @param outputStream
@ -70,12 +72,14 @@ public class PostCommitHook extends GitHook<Void> {
super(repo, outputStream);
}
/** {@inheritDoc} */
@Override
public Void call() throws IOException, AbortedByHookException {
doRun();
return null;
}
/** {@inheritDoc} */
@Override
public String getHookName() {
return NAME;

4
org.eclipse.jgit/src/org/eclipse/jgit/hooks/PreCommitHook.java

@ -60,6 +60,8 @@ public class PreCommitHook extends GitHook<Void> {
public static final String NAME = "pre-commit"; //$NON-NLS-1$
/**
* Constructor for PreCommitHook
*
* @param repo
* The repository
* @param outputStream
@ -70,12 +72,14 @@ public class PreCommitHook extends GitHook<Void> {
super(repo, outputStream);
}
/** {@inheritDoc} */
@Override
public Void call() throws IOException, AbortedByHookException {
doRun();
return null;
}
/** {@inheritDoc} */
@Override
public String getHookName() {
return NAME;

16
org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java

@ -72,6 +72,8 @@ public class PrePushHook extends GitHook<String> {
private String refs;
/**
* Constructor for PrePushHook
*
* @param repo
* The repository
* @param outputStream
@ -82,11 +84,13 @@ public class PrePushHook extends GitHook<String> {
super(repo, outputStream);
}
/** {@inheritDoc} */
@Override
protected String getStdinArgs() {
return refs;
}
/** {@inheritDoc} */
@Override
public String call() throws IOException, AbortedByHookException {
if (canRun()) {
@ -102,12 +106,15 @@ public class PrePushHook extends GitHook<String> {
return true;
}
/** {@inheritDoc} */
@Override
public String getHookName() {
return NAME;
}
/**
* {@inheritDoc}
* <p>
* This hook receives two parameters, which is the name and the location of
* the remote repository.
*/
@ -120,21 +127,30 @@ public class PrePushHook extends GitHook<String> {
}
/**
* Set remote name
*
* @param name
* remote name
*/
public void setRemoteName(String name) {
remoteName = name;
}
/**
* Set remote location
*
* @param location
* a remote location
*/
public void setRemoteLocation(String location) {
remoteLocation = location;
}
/**
* Set Refs
*
* @param toRefs
* a collection of {@code RemoteRefUpdate}s
*/
public void setRefs(Collection<RemoteRefUpdate> toRefs) {
StringBuilder b = new StringBuilder();

Loading…
Cancel
Save