Package org.eclipse.jgit.api
Class SubmoduleUpdateCommand
- java.lang.Object
-
- org.eclipse.jgit.api.GitCommand<T>
-
- org.eclipse.jgit.api.TransportCommand<SubmoduleUpdateCommand,java.util.Collection<java.lang.String>>
-
- org.eclipse.jgit.api.SubmoduleUpdateCommand
-
- All Implemented Interfaces:
java.util.concurrent.Callable<java.util.Collection<java.lang.String>>
public class SubmoduleUpdateCommand extends TransportCommand<SubmoduleUpdateCommand,java.util.Collection<java.lang.String>>
A class used to execute a submodule update command.- See Also:
- Git documentation about submodules
-
-
Field Summary
Fields Modifier and Type Field Description private CloneCommand.Callbackcallbackprivate booleanfetchprivate FetchCommand.CallbackfetchCallbackprivate ProgressMonitormonitorprivate java.util.Collection<java.lang.String>pathsprivate MergeStrategystrategy-
Fields inherited from class org.eclipse.jgit.api.TransportCommand
credentialsProvider, timeout, transportConfigCallback
-
Fields inherited from class org.eclipse.jgit.api.GitCommand
repo
-
-
Constructor Summary
Constructors Constructor Description SubmoduleUpdateCommand(Repository repo)Constructor for SubmoduleUpdateCommand.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SubmoduleUpdateCommandaddPath(java.lang.String path)Add repository-relative submodule path to initializejava.util.Collection<java.lang.String>call()Execute the SubmoduleUpdateCommand command.private RepositorygetOrCloneSubmodule(SubmoduleWalk generator, java.lang.String url)SubmoduleUpdateCommandsetCallback(CloneCommand.Callback callback)Set status callback for submodule clone operation.SubmoduleUpdateCommandsetFetch(boolean fetch)Whether to fetch the submodules before we update them.SubmoduleUpdateCommandsetFetchCallback(FetchCommand.Callback callback)Set status callback for submodule fetch operation.SubmoduleUpdateCommandsetProgressMonitor(ProgressMonitor monitor)The progress monitor associated with the clone operation.SubmoduleUpdateCommandsetStrategy(MergeStrategy strategy)Setter for the fieldstrategy.-
Methods inherited from class org.eclipse.jgit.api.TransportCommand
configure, configure, self, setCredentialsProvider, setTimeout, setTransportConfigCallback
-
Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
-
-
-
-
Field Detail
-
monitor
private ProgressMonitor monitor
-
paths
private final java.util.Collection<java.lang.String> paths
-
strategy
private MergeStrategy strategy
-
callback
private CloneCommand.Callback callback
-
fetchCallback
private FetchCommand.Callback fetchCallback
-
fetch
private boolean fetch
-
-
Constructor Detail
-
SubmoduleUpdateCommand
public SubmoduleUpdateCommand(Repository repo)
Constructor for SubmoduleUpdateCommand.
- Parameters:
repo- aRepositoryobject.
-
-
Method Detail
-
setProgressMonitor
public SubmoduleUpdateCommand setProgressMonitor(ProgressMonitor monitor)
The progress monitor associated with the clone operation. By default, this is set toNullProgressMonitor- Parameters:
monitor- aProgressMonitorobject.- Returns:
- this command
- See Also:
NullProgressMonitor
-
setFetch
public SubmoduleUpdateCommand setFetch(boolean fetch)
Whether to fetch the submodules before we update them. By default, this is set tofalse- Parameters:
fetch- whether to fetch the submodules before we update them- Returns:
- this command
- Since:
- 4.9
-
addPath
public SubmoduleUpdateCommand addPath(java.lang.String path)
Add repository-relative submodule path to initialize- Parameters:
path- (with/as separator)- Returns:
- this command
-
getOrCloneSubmodule
private Repository getOrCloneSubmodule(SubmoduleWalk generator, java.lang.String url) throws java.io.IOException, GitAPIException
- Throws:
java.io.IOExceptionGitAPIException
-
call
public java.util.Collection<java.lang.String> call() throws InvalidConfigurationException, NoHeadException, ConcurrentRefUpdateException, CheckoutConflictException, InvalidMergeHeadsException, WrongRepositoryStateException, NoMessageException, NoHeadException, RefNotFoundException, GitAPIExceptionExecute the command Execute the SubmoduleUpdateCommand command.
- Specified by:
callin interfacejava.util.concurrent.Callable<java.util.Collection<java.lang.String>>- Specified by:
callin classGitCommand<java.util.Collection<java.lang.String>>- Throws:
InvalidConfigurationExceptionNoHeadExceptionConcurrentRefUpdateExceptionCheckoutConflictExceptionInvalidMergeHeadsExceptionWrongRepositoryStateExceptionNoMessageExceptionRefNotFoundExceptionGitAPIException
-
setStrategy
public SubmoduleUpdateCommand setStrategy(MergeStrategy strategy)
Setter for the fieldstrategy.- Parameters:
strategy- The merge strategy to use during this update operation.- Returns:
this- Since:
- 3.4
-
setCallback
public SubmoduleUpdateCommand setCallback(CloneCommand.Callback callback)
Set status callback for submodule clone operation.- Parameters:
callback- the callback- Returns:
this- Since:
- 4.8
-
setFetchCallback
public SubmoduleUpdateCommand setFetchCallback(FetchCommand.Callback callback)
Set status callback for submodule fetch operation.- Parameters:
callback- the callback- Returns:
this- Since:
- 4.9
-
-