@ -56,6 +56,7 @@ import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.NullProgressMonitor ;
import org.eclipse.jgit.lib.NullProgressMonitor ;
import org.eclipse.jgit.lib.ProgressMonitor ;
import org.eclipse.jgit.lib.ProgressMonitor ;
import org.eclipse.jgit.lib.Repository ;
import org.eclipse.jgit.lib.Repository ;
import org.eclipse.jgit.transport.CredentialsProvider ;
import org.eclipse.jgit.transport.FetchResult ;
import org.eclipse.jgit.transport.FetchResult ;
import org.eclipse.jgit.transport.RefSpec ;
import org.eclipse.jgit.transport.RefSpec ;
import org.eclipse.jgit.transport.Transport ;
import org.eclipse.jgit.transport.Transport ;
@ -86,6 +87,8 @@ public class FetchCommand extends GitCommand<FetchResult> {
private int timeout ;
private int timeout ;
private CredentialsProvider credentialsProvider ;
/ * *
/ * *
* @param repo
* @param repo
@ -121,6 +124,7 @@ public class FetchCommand extends GitCommand<FetchResult> {
transport . setTimeout ( timeout ) ;
transport . setTimeout ( timeout ) ;
transport . setDryRun ( dryRun ) ;
transport . setDryRun ( dryRun ) ;
transport . setFetchThin ( thin ) ;
transport . setFetchThin ( thin ) ;
transport . setCredentialsProvider ( credentialsProvider ) ;
try {
try {
FetchResult result = transport . fetch ( monitor , refSpecs ) ;
FetchResult result = transport . fetch ( monitor , refSpecs ) ;
@ -318,4 +322,11 @@ public class FetchCommand extends GitCommand<FetchResult> {
return this ;
return this ;
}
}
/ * *
* @param credentialsProvider
* the { @link CredentialsProvider } to use
* /
public void setCredentialsProvider ( CredentialsProvider credentialsProvider ) {
this . credentialsProvider = credentialsProvider ;
}
}
}