- java.lang.Object
-
- org.eclipse.jgit.api.GitCommand<Collection<SubmoduleDeinitResult>>
-
- org.eclipse.jgit.api.SubmoduleDeinitCommand
-
- All Implemented Interfaces:
Callable<Collection<SubmoduleDeinitResult>>
public class SubmoduleDeinitCommand extends GitCommand<Collection<SubmoduleDeinitResult>>
A class used to execute a submodule deinit command.This will remove the module(s) from the working tree, but won't affect .git/modules.
- Since:
- 4.10
- See Also:
- Git documentation about submodules
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSubmoduleDeinitCommand.NoSuchSubmoduleExceptionThe user tried to deinitialize a submodule that doesn't exist in the index.static classSubmoduleDeinitCommand.SubmoduleDeinitStatusThe effect of a submodule deinit command for a given path
-
Field Summary
-
Fields inherited from class org.eclipse.jgit.api.GitCommand
repo
-
-
Constructor Summary
Constructors Constructor Description SubmoduleDeinitCommand(Repository repo)Constructor of SubmoduleDeinitCommand
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SubmoduleDeinitCommandaddPath(String path)Add repository-relative submodule path to deinitializeCollection<SubmoduleDeinitResult>call()SubmoduleDeinitCommandsetForce(boolean force)Iftrue, call() will deinitialize modules with local changes; else it will refuse to do so.-
Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
-
-
-
-
Constructor Detail
-
SubmoduleDeinitCommand
public SubmoduleDeinitCommand(Repository repo)
Constructor of SubmoduleDeinitCommand- Parameters:
repo-
-
-
Method Detail
-
call
public Collection<SubmoduleDeinitResult> call() throws GitAPIException
Execute the command
- Specified by:
callin interfaceCallable<Collection<SubmoduleDeinitResult>>- Specified by:
callin classGitCommand<Collection<SubmoduleDeinitResult>>- Returns:
- the set of repositories successfully deinitialized.
- Throws:
SubmoduleDeinitCommand.NoSuchSubmoduleException- if any of the submodules which we might want to deinitialize don't existGitAPIException
-
addPath
public SubmoduleDeinitCommand addPath(String path)
Add repository-relative submodule path to deinitialize- Parameters:
path- (with/as separator)- Returns:
- this command
-
setForce
public SubmoduleDeinitCommand setForce(boolean force)
Iftrue, call() will deinitialize modules with local changes; else it will refuse to do so.- Parameters:
force-- Returns:
this
-
-