Package org.eclipse.jgit.api
Class SubmoduleAddCommand
java.lang.Object
org.eclipse.jgit.api.GitCommand<Repository>
org.eclipse.jgit.api.TransportCommand<SubmoduleAddCommand,Repository>
org.eclipse.jgit.api.SubmoduleAddCommand
- All Implemented Interfaces:
Callable<Repository>
A class used to execute a submodule add command.
This will clone the configured submodule, register the submodule in the
.gitmodules file and the repository config file, and also add the submodule
and .gitmodules file to the index.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ProgressMonitor
private String
private String
private String
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 -
Method Summary
Modifier and TypeMethodDescriptioncall()
Set the submodule nameSet repository-relative path of submodulesetProgressMonitor
(ProgressMonitor monitor) The progress monitor associated with the clone operation.Set URI to clone submodule fromprotected boolean
Is the configured already a submodule in the index?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 Details
-
name
-
path
-
uri
-
monitor
-
-
Constructor Details
-
SubmoduleAddCommand
Constructor for SubmoduleAddCommand.- Parameters:
repo
- aRepository
object.
-
-
Method Details
-
setName
Set the submodule name- Parameters:
name
-- Returns:
- this command
- Since:
- 5.1
-
setPath
Set repository-relative path of submodule- Parameters:
path
- (with/
as separator)- Returns:
- this command
-
setURI
Set URI to clone submodule from- Parameters:
uri
- aString
object.- Returns:
- this command
-
setProgressMonitor
The progress monitor associated with the clone operation. By default, this is set toNullProgressMonitor
- Parameters:
monitor
- aProgressMonitor
object.- Returns:
- this command
- See Also:
-
submoduleExists
Is the configured already a submodule in the index?- Returns:
- true if submodule exists in index, false otherwise
- Throws:
IOException
-
call
Execute the command
Executes the
SubmoduleAddCommand
TheRepository
instance returned by this command needs to be closed by the caller to free resources held by theRepository
instance. It is recommended to call this method as soon as you don't need a reference to thisRepository
instance anymore.- Specified by:
call
in interfaceCallable<Repository>
- Specified by:
call
in classGitCommand<Repository>
- Throws:
GitAPIException
-