Top Description Fields Constructors Methods
org.eclipse.jgit.api

public Class SubmoduleUpdateCommand

extends TransportCommand<SubmoduleUpdateCommand, Collection<String>>
Class Inheritance
Imports
java.io.File, .IOException, java.util.ArrayList, .Collection, .List, org.eclipse.jgit.api.errors.CheckoutConflictException, .ConcurrentRefUpdateException, .GitAPIException, .InvalidConfigurationException, .InvalidMergeHeadsException, .JGitInternalException, .NoHeadException, .NoMessageException, .RefNotFoundException, .WrongRepositoryStateException, org.eclipse.jgit.dircache.DirCacheCheckout, org.eclipse.jgit.errors.ConfigInvalidException, org.eclipse.jgit.internal.storage.file.LockFile, org.eclipse.jgit.lib.ConfigConstants, .Constants, .NullProgressMonitor, .ProgressMonitor, .RefUpdate, .Repository, org.eclipse.jgit.merge.MergeStrategy, org.eclipse.jgit.revwalk.RevCommit, .RevWalk, org.eclipse.jgit.submodule.SubmoduleWalk, org.eclipse.jgit.treewalk.filter.PathFilterGroup, org.eclipse.jgit.util.FileUtils

A class used to execute a submodule update command.
See Also
Git documentation about submodules

Field Summary

Modifier and TypeField and Description
private CloneCommand.Callback
private boolean
private boolean
private FetchCommand.Callback
private ProgressMonitor
private final Collection<String>
private MergeStrategy
Inherited from org.eclipse.jgit.api.TransportCommand:
credentialsProvidertimeouttransportConfigCallback

Constructor Summary

AccessConstructor and Description
public
SubmoduleUpdateCommand(Repository repo)

Constructor for SubmoduleUpdateCommand.

Method Summary

Modifier and TypeMethod and Description
public SubmoduleUpdateCommand

Returns:

this command
addPath
(String
(with / as separator)
path
)

Add repository-relative submodule path to initialize

public Collection<String>
call()

Implements abstract org.eclipse.jgit.api.GitCommand.call.

Implements java.util.concurrent.Callable.call.

Computes a result, or throws an exception if unable to do so.

private String
private Repository
private static String
getRelativePath(File gitDir, File workingTree)

private static void
restoreSubmodule(File gitDir, File workingTree)

public SubmoduleUpdateCommand

Returns:

this
setCallback
(CloneCommand.Callback
the callback
callback
)

Set status callback for submodule clone operation.

public SubmoduleUpdateCommand

Returns:

this command
setFetch
(boolean
whether to fetch the submodules before we update them
fetch
)

Whether to fetch the submodules before we update them.

public SubmoduleUpdateCommand

Returns:

this
setFetchCallback
(FetchCommand.Callback
the callback
callback
)

Set status callback for submodule fetch operation.

public SubmoduleUpdateCommand

Returns:

this command
setProgressMonitor
(final ProgressMonitor monitor)

The progress monitor associated with the clone operation.

public SubmoduleUpdateCommand

Returns:

this
setStrategy
(MergeStrategy
The merge strategy to use during this update operation.
strategy
)

Setter for the field strategy.

private static boolean
Inherited from org.eclipse.jgit.api.TransportCommand:
configureconfigureselfsetCredentialsProvidersetTimeoutsetTransportConfigCallback

Field Detail

callbackback to summary
private CloneCommand.Callback callback
clonedRestoredback to summary
private boolean clonedRestored
fetchback to summary
private boolean fetch
fetchCallbackback to summary
private FetchCommand.Callback fetchCallback
monitorback to summary
private ProgressMonitor monitor
pathsback to summary
private final Collection<String> paths
strategyback to summary
private MergeStrategy strategy

Constructor Detail

SubmoduleUpdateCommandback to summary
public SubmoduleUpdateCommand(Repository repo)

Constructor for SubmoduleUpdateCommand.

Parameters
repo:Repository

a org.eclipse.jgit.lib.Repository object.

Method Detail

addPathback to summary
public SubmoduleUpdateCommand addPath(String path)

Add repository-relative submodule path to initialize

Parameters
path:String

(with / as separator)

Returns:SubmoduleUpdateCommand

this command

callback to summary
public Collection<String> call() throws InvalidConfigurationException, NoHeadException, ConcurrentRefUpdateException, CheckoutConflictException, InvalidMergeHeadsException, WrongRepositoryStateException, NoMessageException, NoHeadException, RefNotFoundException, GitAPIException

Implements abstract org.eclipse.jgit.api.GitCommand.call.

Implements java.util.concurrent.Callable.call.

Doc from org.eclipse.jgit.api.GitCommand.call.

Computes a result, or throws an exception if unable to do so.

Execute the command Execute the SubmoduleUpdateCommand command.

Returns:Collection<String>

Doc from java.util.concurrent.Callable.call.

computed result

Annotations
@Override
determineUpdateModeback to summary
private String determineUpdateMode(String mode)
getOrCloneSubmoduleback to summary
private Repository getOrCloneSubmodule(SubmoduleWalk generator, String url) throws IOException, GitAPIException
getRelativePathback to summary
private static String getRelativePath(File gitDir, File workingTree)
restoreSubmoduleback to summary
private static void restoreSubmodule(File gitDir, File workingTree) throws IOException
setCallbackback to summary
public SubmoduleUpdateCommand setCallback(CloneCommand.Callback callback)

Set status callback for submodule clone operation.

Parameters
callback:CloneCommand.Callback

the callback

Returns:SubmoduleUpdateCommand

this

Since
4.8
setFetchback to summary
public SubmoduleUpdateCommand setFetch(boolean fetch)

Whether to fetch the submodules before we update them. By default, this is set to false

Parameters
fetch:boolean

whether to fetch the submodules before we update them

Returns:SubmoduleUpdateCommand

this command

Since
4.9
setFetchCallbackback to summary
public SubmoduleUpdateCommand setFetchCallback(FetchCommand.Callback callback)

Set status callback for submodule fetch operation.

Parameters
callback:FetchCommand.Callback

the callback

Returns:SubmoduleUpdateCommand

this

Since
4.9
setProgressMonitorback to summary
public SubmoduleUpdateCommand setProgressMonitor(final ProgressMonitor monitor)

The progress monitor associated with the clone operation. By default, this is set to NullProgressMonitor

Parameters
monitor:ProgressMonitor

a org.eclipse.jgit.lib.ProgressMonitor object.

Returns:SubmoduleUpdateCommand

this command

See Also
NullProgressMonitor
setStrategyback to summary
public SubmoduleUpdateCommand setStrategy(MergeStrategy strategy)

Setter for the field strategy.

Parameters
strategy:MergeStrategy

The merge strategy to use during this update operation.

Returns:SubmoduleUpdateCommand

this

Since
3.4
submoduleExistsback to summary
private static boolean submoduleExists(File gitDir)