org.eclipse.jgit.lib
Enum RepositoryState

java.lang.Object
  extended by java.lang.Enum<RepositoryState>
      extended by org.eclipse.jgit.lib.RepositoryState
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<RepositoryState>

public enum RepositoryState
extends java.lang.Enum<RepositoryState>

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.


Enum Constant Summary
APPLY
          An unfinished apply.
BISECTING
          Bisecting being done.
MERGING
          An unfinished merge.
REBASING
          An unfinished rebase or am.
REBASING_INTERACTIVE
          An unfinished interactive rebase.
REBASING_MERGE
          An unfinished rebase with merge.
REBASING_REBASING
          An unfinished rebase.
SAFE
          A safe state for working normally
 
Method Summary
abstract  boolean canCheckout()
           
abstract  boolean canCommit()
           
abstract  boolean canResetHead()
           
abstract  java.lang.String getDescription()
           
static RepositoryState valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static RepositoryState[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SAFE

public static final RepositoryState SAFE
A safe state for working normally


MERGING

public static final RepositoryState MERGING
An unfinished merge. Must resole or reset before continuing normally


REBASING

public static final RepositoryState REBASING
An unfinished rebase or am. Must resolve, skip or abort before normal work can take place


REBASING_REBASING

public static final RepositoryState REBASING_REBASING
An unfinished rebase. Must resolve, skip or abort before normal work can take place


APPLY

public static final RepositoryState APPLY
An unfinished apply. Must resolve, skip or abort before normal work can take place


REBASING_MERGE

public static final RepositoryState REBASING_MERGE
An unfinished rebase with merge. Must resolve, skip or abort before normal work can take place


REBASING_INTERACTIVE

public static final RepositoryState REBASING_INTERACTIVE
An unfinished interactive rebase. Must resolve, skip or abort before normal work can take place


BISECTING

public static final RepositoryState BISECTING
Bisecting being done. Normal work may continue but is discouraged

Method Detail

values

public static RepositoryState[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (RepositoryState c : RepositoryState.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static RepositoryState valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

canCheckout

public abstract boolean canCheckout()
Returns:
true if changing HEAD is sane.

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

getDescription

public abstract java.lang.String getDescription()
Returns:
a human readable description of the state.