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

public Class SubmoduleSyncCommand

extends GitCommand<Map<String, String>>
Class Inheritance
Imports
java.io.IOException, java.util.ArrayList, .Collection, .HashMap, .Map, org.eclipse.jgit.api.errors.GitAPIException, .JGitInternalException, org.eclipse.jgit.errors.ConfigInvalidException, org.eclipse.jgit.lib.ConfigConstants, .Constants, .Ref, .Repository, .StoredConfig, org.eclipse.jgit.submodule.SubmoduleWalk, org.eclipse.jgit.treewalk.filter.PathFilterGroup

A class used to execute a submodule sync command. This will set the remote URL in a submodule's repository to the current value in the .gitmodules file.
See Also
Git documentation about submodules

Field Summary

Modifier and TypeField and Description
private final Collection<String>
Inherited from org.eclipse.jgit.api.GitCommand:
repo

Constructor Summary

AccessConstructor and Description
public
SubmoduleSyncCommand(Repository repo)

Constructor for SubmoduleSyncCommand.

Method Summary

Modifier and TypeMethod and Description
public SubmoduleSyncCommand

Returns:

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

Add repository-relative submodule path to synchronize

public Map<String, 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.

protected String

Returns:

shortened branch name, null on failures
getHeadBranch
(Repository subRepo)

Get branch that HEAD currently points to

Inherited from org.eclipse.jgit.api.GitCommand:
checkCallablegetRepositorysetCallable

Field Detail

pathsback to summary
private final Collection<String> paths

Constructor Detail

SubmoduleSyncCommandback to summary
public SubmoduleSyncCommand(Repository repo)

Constructor for SubmoduleSyncCommand.

Parameters
repo:Repository

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

Method Detail

addPathback to summary
public SubmoduleSyncCommand addPath(String path)

Add repository-relative submodule path to synchronize

Parameters
path:String

(with / as separator)

Returns:SubmoduleSyncCommand

this command

callback to summary
public Map<String, String> call() throws 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

Returns:Map<String, String>

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

computed result

Annotations
@Override
getHeadBranchback to summary
protected String getHeadBranch(Repository subRepo) throws IOException

Get branch that HEAD currently points to

Parameters
subRepo:Repository

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

Returns:String

shortened branch name, null on failures

Exceptions
IOException:
if an IO error occurred