org.eclipse.jgit.api
Class SubmoduleSyncCommand
java.lang.Object
org.eclipse.jgit.api.GitCommand<java.util.Map<java.lang.String,java.lang.String>>
org.eclipse.jgit.api.SubmoduleSyncCommand
- All Implemented Interfaces:
- java.util.concurrent.Callable<java.util.Map<java.lang.String,java.lang.String>>
public class SubmoduleSyncCommand
- extends GitCommand<java.util.Map<java.lang.String,java.lang.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
Method Summary |
SubmoduleSyncCommand |
addPath(java.lang.String path)
Add repository-relative submodule path to synchronize |
java.util.Map<java.lang.String,java.lang.String> |
call()
Executes the command |
protected java.lang.String |
getHeadBranch(Repository subRepo)
Get branch that HEAD currently points to |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SubmoduleSyncCommand
public SubmoduleSyncCommand(Repository repo)
- Parameters:
repo
-
addPath
public SubmoduleSyncCommand addPath(java.lang.String path)
- Add repository-relative submodule path to synchronize
- Parameters:
path
-
- Returns:
- this command
getHeadBranch
protected java.lang.String getHeadBranch(Repository subRepo)
throws java.io.IOException
- Get branch that HEAD currently points to
- Parameters:
subRepo
-
- Returns:
- shortened branch name, null on failures
- Throws:
java.io.IOException
call
public java.util.Map<java.lang.String,java.lang.String> call()
throws GitAPIException
- Description copied from class:
GitCommand
- Executes the command
- Specified by:
call
in interface java.util.concurrent.Callable<java.util.Map<java.lang.String,java.lang.String>>
- Specified by:
call
in class GitCommand<java.util.Map<java.lang.String,java.lang.String>>
- Returns:
- T a result. Each command has its own return type
- Throws:
GitAPIException
- or subclass thereof when an error occurs
Copyright © 2013. All Rights Reserved.