Package org.eclipse.jgit.lib
Enum Class RepositoryState
- All Implemented Interfaces:
Serializable
,Comparable<RepositoryState>
,Constable
Important state of the repository that affects what can and cannot bed
done. This is things like unhandled conflicted merges and unfinished rebase.
The granularity and set of states are somewhat arbitrary. The methods
on the state are the only supported means of deciding what to do.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAn unfinished apply.Has no work tree and cannot be used for normal editing.Bisecting being done.An unfinished cherry-pick.A cherry-pick where all conflicts have been resolved.An unfinished merge.An merge where all conflicts have been resolved.An unfinished rebase or am.An unfinished interactive rebase.An unfinished rebase with merge.An unfinished rebase.An unfinished revert.A revert where all conflicts have been resolved.A safe state for working normally -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
canAmend()
abstract boolean
Whether checkout can be done.abstract boolean
abstract boolean
abstract String
abstract boolean
static RepositoryState
Returns the enum constant of this class with the specified name.static RepositoryState[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BARE
Has no work tree and cannot be used for normal editing. -
SAFE
A safe state for working normally -
MERGING
An unfinished merge. Must resolve or reset before continuing normally -
MERGING_RESOLVED
An merge where all conflicts have been resolved. The index does not contain any unmerged paths. -
CHERRY_PICKING
An unfinished cherry-pick. Must resolve or reset before continuing normally -
CHERRY_PICKING_RESOLVED
A cherry-pick where all conflicts have been resolved. The index does not contain any unmerged paths. -
REVERTING
An unfinished revert. Must resolve or reset before continuing normally -
REVERTING_RESOLVED
A revert where all conflicts have been resolved. The index does not contain any unmerged paths. -
REBASING
An unfinished rebase or am. Must resolve, skip or abort before normal work can take place -
REBASING_REBASING
An unfinished rebase. Must resolve, skip or abort before normal work can take place -
APPLY
An unfinished apply. Must resolve, skip or abort before normal work can take place -
REBASING_MERGE
An unfinished rebase with merge. Must resolve, skip or abort before normal work can take place -
REBASING_INTERACTIVE
An unfinished interactive rebase. Must resolve, skip or abort before normal work can take place -
BISECTING
Bisecting being done. Normal work may continue but is discouraged
-
-
Constructor Details
-
RepositoryState
private RepositoryState()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
canCheckout
public abstract boolean canCheckout()Whether checkout can be done.- Returns:
- whether checkout can be done.
-
canCommit
public abstract boolean canCommit()- Returns:
- true if we can commit
-
canResetHead
public abstract boolean canResetHead()- Returns:
- true if reset to another HEAD is considered SAFE
-
canAmend
public abstract boolean canAmend()- Returns:
- true if amending is considered SAFE
-
isRebasing
public abstract boolean isRebasing()- Returns:
- true if the repository is currently in a rebase
- Since:
- 3.0
-
getDescription
- Returns:
- a human readable description of the state.
-