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:
Serializable, Comparable<RepositoryState>

public enum RepositoryState
extends 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.
BARE
          Has no work tree and cannot be used for normal editing.
BISECTING
          Bisecting being done.
CHERRY_PICKING
          An unfinished cherry-pick.
CHERRY_PICKING_RESOLVED
          A cherry-pick where all conflicts have been resolved.
MERGING
          An unfinished merge.
MERGING_RESOLVED
          An merge where all conflicts have been resolved.
REBASING
          An unfinished rebase or am.
REBASING_INTERACTIVE
          An unfinished interactive rebase.
REBASING_MERGE
          An unfinished rebase with merge.
REBASING_REBASING
          An unfinished rebase.
REVERTING
          An unfinished revert.
REVERTING_RESOLVED
          A revert where all conflicts have been resolved.
SAFE
          A safe state for working normally
 
Method Summary
abstract  boolean canAmend()
           
abstract  boolean canCheckout()
           
abstract  boolean canCommit()
           
abstract  boolean canResetHead()
           
abstract  String getDescription()
           
static RepositoryState valueOf(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

BARE

public static final RepositoryState BARE
Has no work tree and cannot be used for normal editing.


SAFE

public static final RepositoryState SAFE
A safe state for working normally


MERGING

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


MERGING_RESOLVED

public static final RepositoryState MERGING_RESOLVED
An merge where all conflicts have been resolved. The index does not contain any unmerged paths.


CHERRY_PICKING

public static final RepositoryState CHERRY_PICKING
An unfinished cherry-pick. Must resolve or reset before continuing normally


CHERRY_PICKING_RESOLVED

public static final RepositoryState CHERRY_PICKING_RESOLVED
A cherry-pick where all conflicts have been resolved. The index does not contain any unmerged paths.


REVERTING

public static final RepositoryState REVERTING
An unfinished revert. Must resolve or reset before continuing normally


REVERTING_RESOLVED

public static final RepositoryState REVERTING_RESOLVED
A revert where all conflicts have been resolved. The index does not contain any unmerged paths.


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(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:
IllegalArgumentException - if this enum type has no constant with the specified name
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

canAmend

public abstract boolean canAmend()
Returns:
true if amending is considered SAFE

getDescription

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


Copyright © 2013. All Rights Reserved.