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

public Class Status

extends Object
Class Inheritance
Imports
java.util.Collections, .HashSet, .Map, .Set, org.eclipse.jgit.lib.IndexDiff, .IndexDiff.StageState

A class telling where the working-tree, the index and the current HEAD differ from each other. Collections are exposed containing the paths of the modified files. E.g. to find out which files are dirty in the working tree (modified but not added) you would inspect the collection returned by getModified().

The same path can be returned by multiple getters. E.g. if a modification has been added to the index and afterwards the corresponding working tree file is again modified this path will be returned by getModified() and getChanged()

Field Summary

Modifier and TypeField and Description
private final boolean
private final IndexDiff
private final boolean

Constructor Summary

AccessConstructor and Description
public
Status(IndexDiff
the org.eclipse.jgit.lib.IndexDiff having the status
diff
)

Constructor for Status.

Method Summary

Modifier and TypeMethod and Description
public Set<String>

Returns:

list of files added to the index, not in HEAD (e.g. what you get if you call git add ... on a newly created file)
getAdded
()

Get files added to the index

public Set<String>

Returns:

list of files changed from HEAD to index (e.g. what you get if you modify an existing file and call 'git add ...' on it)
getChanged
()

Get changed files from HEAD to index

public Set<String>

Returns:

list of files that are in conflict. (e.g what you get if you modify file that was modified by someone else in the meantime)
getConflicting
()

Get conflicting files

public Map<String, IndexDiff.StageState>

Returns:

a map from conflicting path to its org.eclipse.jgit.lib.IndexDiff.StageState.
getConflictingStageState
()

Get StageState of conflicting files

public Set<String>

Returns:

set of files and folders that are ignored and not in the index.
getIgnoredNotInIndex
()

Get ignored files which are not in the index

public Set<String>

Returns:

list of files in index, but not filesystem (e.g. what you get if you call 'rm ...' on a existing file)
getMissing
()

Get missing files

public Set<String>

Returns:

list of files modified on disk relative to the index (e.g. what you get if you modify an existing file without adding it to the index)
getModified
()

Get modified files relative to the index

public Set<String>

Returns:

list of files removed from index, but in HEAD (e.g. what you get if you call 'git rm ...' on a existing file)
getRemoved
()

Get removed files

public Set<String>

Returns:

set of files and folders that are known to the repo and changed either in the index or in the working tree.
getUncommittedChanges
()

Get uncommitted changes, i.e. all files changed in the index or working tree

public Set<String>

Returns:

list of files that are not ignored, and not in the index. (e.g. what you get if you create a new file without adding it to the index)
getUntracked
()

Get untracked files

public Set<String>

Returns:

set of directories that are not ignored, and not in the index.
getUntrackedFolders
()

Get untracked folders

public boolean

Returns:

true if any tracked file is changed
hasUncommittedChanges
()

Whether there are uncommitted changes

public boolean

Returns:

true if no differences exist between the working-tree, the index, and the current HEAD, false if differences do exist
isClean
()

Whether the status is clean

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cleanback to summary
private final boolean clean
diffback to summary
private final IndexDiff diff
hasUncommittedChangesback to summary
private final boolean hasUncommittedChanges

Constructor Detail

Statusback to summary
public Status(IndexDiff diff)

Constructor for Status.

Parameters
diff:IndexDiff

the org.eclipse.jgit.lib.IndexDiff having the status

Method Detail

getAddedback to summary
public Set<String> getAdded()

Get files added to the index

Returns:Set<String>

list of files added to the index, not in HEAD (e.g. what you get if you call git add ... on a newly created file)

getChangedback to summary
public Set<String> getChanged()

Get changed files from HEAD to index

Returns:Set<String>

list of files changed from HEAD to index (e.g. what you get if you modify an existing file and call 'git add ...' on it)

getConflictingback to summary
public Set<String> getConflicting()

Get conflicting files

Returns:Set<String>

list of files that are in conflict. (e.g what you get if you modify file that was modified by someone else in the meantime)

getConflictingStageStateback to summary
public Map<String, IndexDiff.StageState> getConflictingStageState()

Get StageState of conflicting files

Returns:Map<String, IndexDiff.StageState>

a map from conflicting path to its org.eclipse.jgit.lib.IndexDiff.StageState.

Since
3.0
getIgnoredNotInIndexback to summary
public Set<String> getIgnoredNotInIndex()

Get ignored files which are not in the index

Returns:Set<String>

set of files and folders that are ignored and not in the index.

getMissingback to summary
public Set<String> getMissing()

Get missing files

Returns:Set<String>

list of files in index, but not filesystem (e.g. what you get if you call 'rm ...' on a existing file)

getModifiedback to summary
public Set<String> getModified()

Get modified files relative to the index

Returns:Set<String>

list of files modified on disk relative to the index (e.g. what you get if you modify an existing file without adding it to the index)

getRemovedback to summary
public Set<String> getRemoved()

Get removed files

Returns:Set<String>

list of files removed from index, but in HEAD (e.g. what you get if you call 'git rm ...' on a existing file)

getUncommittedChangesback to summary
public Set<String> getUncommittedChanges()

Get uncommitted changes, i.e. all files changed in the index or working tree

Returns:Set<String>

set of files and folders that are known to the repo and changed either in the index or in the working tree.

Since
3.2
getUntrackedback to summary
public Set<String> getUntracked()

Get untracked files

Returns:Set<String>

list of files that are not ignored, and not in the index. (e.g. what you get if you create a new file without adding it to the index)

getUntrackedFoldersback to summary
public Set<String> getUntrackedFolders()

Get untracked folders

Returns:Set<String>

set of directories that are not ignored, and not in the index.

hasUncommittedChangesback to summary
public boolean hasUncommittedChanges()

Whether there are uncommitted changes

Returns:boolean

true if any tracked file is changed

Since
3.2
isCleanback to summary
public boolean isClean()

Whether the status is clean

Returns:boolean

true if no differences exist between the working-tree, the index, and the current HEAD, false if differences do exist