aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2011-01-28 12:28:28 (EST)
committerChris Aniszczyk2011-01-28 15:06:47 (EST)
commit9fbda2239202ca9d3a20c84d7326f47c667aa920 (patch)
tree5196cab980f703e8235a45f7c14c939c7ac920f6
parenta880233d7fa7a1085aa5e0a124760efcaf47e327 (diff)
downloadjgit-9fbda2239202ca9d3a20c84d7326f47c667aa920.zip
jgit-9fbda2239202ca9d3a20c84d7326f47c667aa920.tar.gz
jgit-9fbda2239202ca9d3a20c84d7326f47c667aa920.tar.bz2
Add setCredentialsProvider to PullCommandrefs/changes/71/2371/2
Bug: 335703 Change-Id: Id9713a4849c772e030fca23dd64b993264f28366 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java
index 73dc452..8bc2103 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java
@@ -70,6 +70,7 @@ import org.eclipse.jgit.lib.ProgressMonitor;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryState;
+import org.eclipse.jgit.transport.CredentialsProvider;
import org.eclipse.jgit.transport.FetchResult;
/**
@@ -85,6 +86,8 @@ public class PullCommand extends GitCommand<PullResult> {
private ProgressMonitor monitor = NullProgressMonitor.INSTANCE;
+ private CredentialsProvider credentialsProvider;
+
/**
* @param repo
*/
@@ -113,6 +116,18 @@ public class PullCommand extends GitCommand<PullResult> {
}
/**
+ * @param credentialsProvider
+ * the {@link CredentialsProvider} to use
+ * @return this instance
+ */
+ public PullCommand setCredentialsProvider(
+ CredentialsProvider credentialsProvider) {
+ checkCallable();
+ this.credentialsProvider = credentialsProvider;
+ return this;
+ }
+
+ /**
* Executes the {@code Pull} command with all the options and parameters
* collected by the setter methods (e.g.
* {@link #setProgressMonitor(ProgressMonitor)}) of this class. Each
@@ -206,6 +221,7 @@ public class PullCommand extends GitCommand<PullResult> {
fetch.setRemote(remote);
fetch.setProgressMonitor(monitor);
fetch.setTimeout(this.timeout);
+ fetch.setCredentialsProvider(credentialsProvider);
fetchRes = fetch.call();
} else {
@@ -293,4 +309,5 @@ public class PullCommand extends GitCommand<PullResult> {
monitor.endTask();
return result;
}
+
}