public enum RepositoryState {
/** Has no work tree and cannot be used for normal editing. */
BARE {
+ @Override
public boolean canCheckout() { return false; }
+
+ @Override
public boolean canResetHead() { return false; }
+
+ @Override
public boolean canCommit() { return false; }
+
+ @Override
public boolean canAmend() { return false; }
+
+ @Override
public String getDescription() { return "Bare"; }
},
* A safe state for working normally
* */
SAFE {
+ @Override
public boolean canCheckout() { return true; }
+
+ @Override
public boolean canResetHead() { return true; }
+
+ @Override
public boolean canCommit() { return true; }
+
+ @Override
public boolean canAmend() { return true; }
+
+ @Override
public String getDescription() { return JGitText.get().repositoryState_normal; }
},
/** An unfinished merge. Must resolve or reset before continuing normally
*/
MERGING {
+ @Override
public boolean canCheckout() { return false; }
+
+ @Override
public boolean canResetHead() { return true; }
+
+ @Override
public boolean canCommit() { return false; }
+
+ @Override
public boolean canAmend() { return false; }
+
+ @Override
public String getDescription() { return JGitText.get().repositoryState_conflicts; }
},
* contain any unmerged paths.
*/
MERGING_RESOLVED {
+ @Override
public boolean canCheckout() { return true; }
+
+ @Override
public boolean canResetHead() { return true; }
+
+ @Override
public boolean canCommit() { return true; }
+
+ @Override
public boolean canAmend() { return false; }
+
+ @Override
public String getDescription() { return JGitText.get().repositoryState_merged; }
},
/** An unfinished cherry-pick. Must resolve or reset before continuing normally
*/
CHERRY_PICKING {
+ @Override
public boolean canCheckout() { return false; }
+
+ @Override
public boolean canResetHead() { return true; }
+
+ @Override
public boolean canCommit() { return false; }
+
+ @Override
public boolean canAmend() { return false; }
+
+ @Override
public String getDescription() { return JGitText.get().repositoryState_conflicts; }
},
* contain any unmerged paths.
*/
CHERRY_PICKING_RESOLVED {
+ @Override
public boolean canCheckout() { return true; }
+
+ @Override
public boolean canResetHead() { return true; }
+
+ @Override
public boolean canCommit() { return true; }
+
+ @Override
public boolean canAmend() { return false; }
+
+ @Override
public String getDescription() { return JGitText.get().repositoryState_merged; }
},
* An unfinished rebase or am. Must resolve, skip or abort before normal work can take place
*/
REBASING {
+ @Override
public boolean canCheckout() { return false; }
+
+ @Override
public boolean canResetHead() { return false; }
+
+ @Override
public boolean canCommit() { return true; }
+
+ @Override
public boolean canAmend() { return true; }
+
+ @Override
public String getDescription() { return JGitText.get().repositoryState_rebaseOrApplyMailbox; }
},
* An unfinished rebase. Must resolve, skip or abort before normal work can take place
*/
REBASING_REBASING {
+ @Override
public boolean canCheckout() { return false; }
+
+ @Override
public boolean canResetHead() { return false; }
+
+ @Override
public boolean canCommit() { return true; }
+
+ @Override
public boolean canAmend() { return true; }
+
+ @Override
public String getDescription() { return JGitText.get().repositoryState_rebase; }
},
* An unfinished apply. Must resolve, skip or abort before normal work can take place
*/
APPLY {
+ @Override
public boolean canCheckout() { return false; }
+
+ @Override
public boolean canResetHead() { return false; }
+
+ @Override
public boolean canCommit() { return true; }
+
+ @Override
public boolean canAmend() { return true; }
+
+ @Override
public String getDescription() { return JGitText.get().repositoryState_applyMailbox; }
},
* An unfinished rebase with merge. Must resolve, skip or abort before normal work can take place
*/
REBASING_MERGE {
+ @Override
public boolean canCheckout() { return false; }
+
+ @Override
public boolean canResetHead() { return false; }
+
+ @Override
public boolean canCommit() { return true; }
+
+ @Override
public boolean canAmend() { return true; }
+
+ @Override
public String getDescription() { return JGitText.get().repositoryState_rebaseWithMerge; }
},
* An unfinished interactive rebase. Must resolve, skip or abort before normal work can take place
*/
REBASING_INTERACTIVE {
+ @Override
public boolean canCheckout() { return false; }
+
+ @Override
public boolean canResetHead() { return false; }
+
+ @Override
public boolean canCommit() { return true; }
+
+ @Override
public boolean canAmend() { return true; }
+
+ @Override
public String getDescription() { return JGitText.get().repositoryState_rebaseInteractive; }
},
*/
BISECTING {
/* Changing head is a normal operation when bisecting */
+ @Override
public boolean canCheckout() { return true; }
/* Do not reset, checkout instead */
+ @Override
public boolean canResetHead() { return false; }
/* Commit during bisect is useful */
+ @Override
public boolean canCommit() { return true; }
+ @Override
public boolean canAmend() { return false; }
+ @Override
public String getDescription() { return JGitText.get().repositoryState_bisecting; }
};