diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java index e75e20fee..f15509b4d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java @@ -325,8 +325,12 @@ public class FetchCommand extends GitCommand { /** * @param credentialsProvider * the {@link CredentialsProvider} to use + * @return {@code this} */ - public void setCredentialsProvider(CredentialsProvider credentialsProvider) { + public FetchCommand setCredentialsProvider( + CredentialsProvider credentialsProvider) { + checkCallable(); this.credentialsProvider = credentialsProvider; + return this; } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java index 6981f77b1..3a35827b9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java @@ -353,8 +353,12 @@ public class PushCommand extends GitCommand> { /** * @param credentialsProvider * the {@link CredentialsProvider} to use + * @return {@code this} */ - public void setCredentialsProvider(CredentialsProvider credentialsProvider) { + public PushCommand setCredentialsProvider( + CredentialsProvider credentialsProvider) { + checkCallable(); this.credentialsProvider = credentialsProvider; + return this; } }