Package org.eclipse.jgit.api
Class SubmoduleSyncCommand
- java.lang.Object
-
- org.eclipse.jgit.api.GitCommand<Map<String,String>>
-
- org.eclipse.jgit.api.SubmoduleSyncCommand
-
public class SubmoduleSyncCommand extends GitCommand<Map<String,String>>
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
-
Fields inherited from class org.eclipse.jgit.api.GitCommand
repo
-
-
Constructor Summary
Constructors Constructor Description SubmoduleSyncCommand(Repository repo)
Constructor for SubmoduleSyncCommand.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SubmoduleSyncCommand
addPath(String path)
Add repository-relative submodule path to synchronizeMap<String,String>
call()
protected String
getHeadBranch(Repository subRepo)
Get branch that HEAD currently points to-
Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
-
-
-
-
Constructor Detail
-
SubmoduleSyncCommand
public SubmoduleSyncCommand(Repository repo)
Constructor for SubmoduleSyncCommand.- Parameters:
repo
- aRepository
object.
-
-
Method Detail
-
addPath
public SubmoduleSyncCommand addPath(String path)
Add repository-relative submodule path to synchronize- Parameters:
path
- (with/
as separator)- Returns:
- this command
-
getHeadBranch
protected String getHeadBranch(Repository subRepo) throws IOException
Get branch that HEAD currently points to- Parameters:
subRepo
- aRepository
object.- Returns:
- shortened branch name, null on failures
- Throws:
IOException
-
call
public Map<String,String> call() throws GitAPIException
Execute the command
-
-