Package org.eclipse.jgit.api
Class StatusCommand
- java.lang.Object
-
- org.eclipse.jgit.api.GitCommand<Status>
-
- org.eclipse.jgit.api.StatusCommand
-
- All Implemented Interfaces:
java.util.concurrent.Callable<Status>
public class StatusCommand extends GitCommand<Status>
A class used to execute aStatus
command. It has setters for all supported options and arguments of this command and acall()
method to finally execute the command. Each instance of this class should only be used for one invocation of the command (means: one call tocall()
)- See Also:
- Git documentation about Status
-
-
Field Summary
-
Fields inherited from class org.eclipse.jgit.api.GitCommand
repo
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
StatusCommand(Repository repo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StatusCommand
addPath(java.lang.String path)
Show only the status of files which match the given paths.Status
call()
Executes theStatus
command with all the options and parameters collected by the setter methods of this class.java.util.List<java.lang.String>
getPaths()
Returns the paths filtering this status.StatusCommand
setIgnoreSubmodules(SubmoduleWalk.IgnoreSubmoduleMode mode)
StatusCommand
setProgressMonitor(ProgressMonitor progressMonitor)
To set theProgressMonitor
which contains callback methods to inform you about the progress of this command.StatusCommand
setWorkingTreeIt(WorkingTreeIterator workingTreeIt)
To set theWorkingTreeIterator
which should be used.-
Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
-
-
-
-
Constructor Detail
-
StatusCommand
protected StatusCommand(Repository repo)
- Parameters:
repo
-
-
-
Method Detail
-
setIgnoreSubmodules
public StatusCommand setIgnoreSubmodules(SubmoduleWalk.IgnoreSubmoduleMode mode)
- Parameters:
mode
-- Returns:
this
- Since:
- 3.6
-
addPath
public StatusCommand addPath(java.lang.String path)
Show only the status of files which match the given paths. The path must either name a file or a directory exactly. All paths are always relative to the repository root. If a directory is specified all files recursively underneath that directory are matched. If this method is called multiple times then the status of those files is reported which match at least one of the given paths. Note that regex expressions or wildcards are not supported.- Parameters:
path
- repository-relative path of file/directory to show status for (with/
as separator)- Returns:
this
- Since:
- 3.1
-
getPaths
public java.util.List<java.lang.String> getPaths()
Returns the paths filtering this status.- Returns:
- the paths for which the status is shown or
null
if the complete status for the whole repo is shown. - Since:
- 3.1
-
call
public Status call() throws GitAPIException, NoWorkTreeException
Executes theStatus
command with all the options and parameters collected by the setter methods of this class. Each instance of this class should only be used for one invocation of the command. Don't call this method twice on an instance.- Specified by:
call
in interfacejava.util.concurrent.Callable<Status>
- Specified by:
call
in classGitCommand<Status>
- Returns:
- a
Status
object telling about each path where working tree, index or HEAD differ from each other. - Throws:
GitAPIException
- or subclass thereof when an error occursNoWorkTreeException
-
setWorkingTreeIt
public StatusCommand setWorkingTreeIt(WorkingTreeIterator workingTreeIt)
To set theWorkingTreeIterator
which should be used. If this method is not called a standardFileTreeIterator
is used.- Parameters:
workingTreeIt
- a working tree iterator- Returns:
this
-
setProgressMonitor
public StatusCommand setProgressMonitor(ProgressMonitor progressMonitor)
To set theProgressMonitor
which contains callback methods to inform you about the progress of this command.- Parameters:
progressMonitor
-- Returns:
this
- Since:
- 3.1
-
-