Top Description Fields Constructors Methods
org.eclipse.jgit.api

public Class StatusCommand

extends GitCommand<Status>
Class Inheritance
Imports
java.io.IOException, java.util.ArrayList, .List, org.eclipse.jgit.api.errors.GitAPIException, .JGitInternalException, org.eclipse.jgit.errors.NoWorkTreeException, org.eclipse.jgit.lib.Constants, .IndexDiff, .ProgressMonitor, .Repository, org.eclipse.jgit.submodule.SubmoduleWalk.IgnoreSubmoduleMode, org.eclipse.jgit.treewalk.FileTreeIterator, .WorkingTreeIterator, org.eclipse.jgit.treewalk.filter.PathFilterGroup

A class used to execute a Status command. It has setters for all supported options and arguments of this command and a call() method to finally execute the command. Each instance of this class should only be used for one invocation of the command (means: one call to call())
See Also
Git documentation about Status

Field Summary

Modifier and TypeField and Description
private SubmoduleWalk.IgnoreSubmoduleMode
private List<String>
private ProgressMonitor
private WorkingTreeIterator
Inherited from org.eclipse.jgit.api.GitCommand:
repo

Constructor Summary

AccessConstructor and Description
protected
StatusCommand(Repository repo)

Constructor for StatusCommand.

Method Summary

Modifier and TypeMethod and Description
public StatusCommand

Returns:

this
addPath
(String
repository-relative path of file/directory to show status for (with / as separator)
path
)

Show only the status of files which match the given paths.

public Status
call()

Implements abstract org.eclipse.jgit.api.GitCommand.call.

Implements java.util.concurrent.Callable.call.

Computes a result, or throws an exception if unable to do so.

public List<String>

Returns:

the paths for which the status is shown or null if the complete status for the whole repo is shown.
getPaths
()

Returns the paths filtering this status.

public StatusCommand
public StatusCommand

Returns:

this
setProgressMonitor
(ProgressMonitor progressMonitor)

To set the org.eclipse.jgit.lib.ProgressMonitor which contains callback methods to inform you about the progress of this command.

public StatusCommand

Returns:

this
setWorkingTreeIt
(WorkingTreeIterator
a working tree iterator
workingTreeIt
)

To set the org.eclipse.jgit.treewalk.WorkingTreeIterator which should be used.

Inherited from org.eclipse.jgit.api.GitCommand:
checkCallablegetRepositorysetCallable

Field Detail

ignoreSubmoduleModeback to summary
private SubmoduleWalk.IgnoreSubmoduleMode ignoreSubmoduleMode
pathsback to summary
private List<String> paths
progressMonitorback to summary
private ProgressMonitor progressMonitor
workingTreeItback to summary
private WorkingTreeIterator workingTreeIt

Constructor Detail

StatusCommandback to summary
protected StatusCommand(Repository repo)

Constructor for StatusCommand.

Parameters
repo:Repository

a org.eclipse.jgit.lib.Repository object.

Method Detail

addPathback to summary
public StatusCommand addPath(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:String

repository-relative path of file/directory to show status for (with / as separator)

Returns:StatusCommand

this

Since
3.1
callback to summary
public Status call() throws GitAPIException, NoWorkTreeException

Implements abstract org.eclipse.jgit.api.GitCommand.call.

Implements java.util.concurrent.Callable.call.

Doc from org.eclipse.jgit.api.GitCommand.call.

Computes a result, or throws an exception if unable to do so.

Execute the command

Executes the Status 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.

Returns:Status

Doc from java.util.concurrent.Callable.call.

computed result

Annotations
@Override
getPathsback to summary
public List<String> getPaths()

Returns the paths filtering this status.

Returns:List<String>

the paths for which the status is shown or null if the complete status for the whole repo is shown.

Since
3.1
setIgnoreSubmodulesback to summary
public StatusCommand setIgnoreSubmodules(SubmoduleWalk.IgnoreSubmoduleMode mode)

Whether to ignore submodules

Parameters
mode:SubmoduleWalk.IgnoreSubmoduleMode

the org.eclipse.jgit.submodule.SubmoduleWalk.IgnoreSubmoduleMode

Returns:StatusCommand

this

Since
3.6
setProgressMonitorback to summary
public StatusCommand setProgressMonitor(ProgressMonitor progressMonitor)

To set the org.eclipse.jgit.lib.ProgressMonitor which contains callback methods to inform you about the progress of this command.

Parameters
progressMonitor:ProgressMonitor

a org.eclipse.jgit.lib.ProgressMonitor object.

Returns:StatusCommand

this

Since
3.1
setWorkingTreeItback to summary
public StatusCommand setWorkingTreeIt(WorkingTreeIterator workingTreeIt)

To set the org.eclipse.jgit.treewalk.WorkingTreeIterator which should be used. If this method is not called a standard org.eclipse.jgit.treewalk.FileTreeIterator is used.

Parameters
workingTreeIt:WorkingTreeIterator

a working tree iterator

Returns:StatusCommand

this