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

public sealed Enum RepositoryState

extends Enum<RepositoryState>
Class Inheritance
Imports
org.eclipse.jgit.internal.JGitText

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.

Field Summary

Modifier and TypeField and Description
public static final RepositoryState
APPLY

An unfinished apply.

public static final RepositoryState
BARE

Has no work tree and cannot be used for normal editing.

public static final RepositoryState
BISECTING

Bisecting being done.

public static final RepositoryState
CHERRY_PICKING

An unfinished cherry-pick.

public static final RepositoryState
CHERRY_PICKING_RESOLVED

A cherry-pick where all conflicts have been resolved.

public static final RepositoryState
MERGING

An unfinished merge.

public static final RepositoryState
MERGING_RESOLVED

An merge where all conflicts have been resolved.

public static final RepositoryState
REBASING

An unfinished rebase or am.

public static final RepositoryState
REBASING_INTERACTIVE

An unfinished interactive rebase.

public static final RepositoryState
REBASING_MERGE

An unfinished rebase with merge.

public static final RepositoryState
REBASING_REBASING

An unfinished rebase.

public static final RepositoryState
REVERTING

An unfinished revert.

public static final RepositoryState
REVERTING_RESOLVED

A revert where all conflicts have been resolved.

public static final RepositoryState
SAFE

A safe state for working normally

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public abstract boolean

Returns:

true if amending is considered SAFE
canAmend
()

Whether amending is considered SAFE

public abstract boolean

Returns:

whether checkout can be done.
canCheckout
()

Whether checkout can be done.

public abstract boolean

Returns:

true if we can commit
canCommit
()

Whether we can commit

public abstract boolean

Returns:

true if reset to another HEAD is considered SAFE
canResetHead
()

Whether reset to another HEAD is considered SAFE

public abstract String

Returns:

a human readable description of the state.
getDescription
()

Get a human readable description of the state

public abstract boolean

Returns:

true if the repository is currently in a rebase
isRebasing
()

Whether a rebase is in progress

public static RepositoryState
public static RepositoryState[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

APPLYback to summary
public static final RepositoryState APPLY

An unfinished apply. Must resolve, skip or abort before normal work can take place

BAREback to summary
public static final RepositoryState BARE

Has no work tree and cannot be used for normal editing.

BISECTINGback to summary
public static final RepositoryState BISECTING

Bisecting being done. Normal work may continue but is discouraged

CHERRY_PICKINGback to summary
public static final RepositoryState CHERRY_PICKING

An unfinished cherry-pick. Must resolve or reset before continuing normally

CHERRY_PICKING_RESOLVEDback to summary
public static final RepositoryState CHERRY_PICKING_RESOLVED

A cherry-pick where all conflicts have been resolved. The index does not contain any unmerged paths.

MERGINGback to summary
public static final RepositoryState MERGING

An unfinished merge. Must resolve or reset before continuing normally

MERGING_RESOLVEDback to summary
public static final RepositoryState MERGING_RESOLVED

An merge where all conflicts have been resolved. The index does not contain any unmerged paths.

REBASINGback to summary
public static final RepositoryState REBASING

An unfinished rebase or am. Must resolve, skip or abort before normal work can take place

REBASING_INTERACTIVEback to summary
public static final RepositoryState REBASING_INTERACTIVE

An unfinished interactive rebase. Must resolve, skip or abort before normal work can take place

REBASING_MERGEback to summary
public static final RepositoryState REBASING_MERGE

An unfinished rebase with merge. Must resolve, skip or abort before normal work can take place

REBASING_REBASINGback to summary
public static final RepositoryState REBASING_REBASING

An unfinished rebase. Must resolve, skip or abort before normal work can take place

REVERTINGback to summary
public static final RepositoryState REVERTING

An unfinished revert. Must resolve or reset before continuing normally

REVERTING_RESOLVEDback to summary
public static final RepositoryState REVERTING_RESOLVED

A revert where all conflicts have been resolved. The index does not contain any unmerged paths.

SAFEback to summary
public static final RepositoryState SAFE

A safe state for working normally

Constructor Detail

RepositoryStateback to summary
private RepositoryState()

Method Detail

canAmendback to summary
public abstract boolean canAmend()

Whether amending is considered SAFE

Returns:boolean

true if amending is considered SAFE

canCheckoutback to summary
public abstract boolean canCheckout()

Whether checkout can be done.

Returns:boolean

whether checkout can be done.

canCommitback to summary
public abstract boolean canCommit()

Whether we can commit

Returns:boolean

true if we can commit

canResetHeadback to summary
public abstract boolean canResetHead()

Whether reset to another HEAD is considered SAFE

Returns:boolean

true if reset to another HEAD is considered SAFE

getDescriptionback to summary
public abstract String getDescription()

Get a human readable description of the state

Returns:String

a human readable description of the state.

isRebasingback to summary
public abstract boolean isRebasing()

Whether a rebase is in progress

Returns:boolean

true if the repository is currently in a rebase

Since
3.0
valueOfback to summary
public static RepositoryState valueOf(String name)
valuesback to summary
public static RepositoryState[] values()