From 414e0cd329a4ade6b98c7df9d832ab272090325a Mon Sep 17 00:00:00 2001 From: Mathias Kinzler Date: Wed, 26 Jan 2011 18:03:22 +0100 Subject: [PATCH] Make setCredentialsProvider more convenient to use Change-Id: I984836ea7d6a67fd2d1d05f270afa7c29f30971c Signed-off-by: Mathias Kinzler --- org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java | 6 +++++- org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) 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; } }