Enum 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 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()
        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

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