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;
/**
private ProgressMonitor monitor = NullProgressMonitor.INSTANCE;
+ private CredentialsProvider credentialsProvider;
+
/**
* @param repo
*/
return this;
}
+ /**
+ * @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.
fetch.setRemote(remote);
fetch.setProgressMonitor(monitor);
fetch.setTimeout(this.timeout);
+ fetch.setCredentialsProvider(credentialsProvider);
fetchRes = fetch.call();
} else {
monitor.endTask();
return result;
}
+
}