diff options
author | Christian Halstrick <christian.halstrick@sap.com> | 2011-11-30 04:55:58 -0500 |
---|---|---|
committer | Code Review <codereview-daemon@eclipse.org> | 2011-11-30 04:55:58 -0500 |
commit | 2238fc9358471db5bf882c4018b3d305b04b20bd (patch) | |
tree | 4b1bf1409061facbdcb66c06dffa2aceec0b5ec6 | |
parent | e9f20c982a0eddad826f4fe6d3c8ff691106eda4 (diff) | |
parent | 99ec987e681c5a21a4a485b778e990e96c52ac51 (diff) | |
download | jgit-2238fc9358471db5bf882c4018b3d305b04b20bd.tar.gz jgit-2238fc9358471db5bf882c4018b3d305b04b20bd.zip |
Merge "RepositoryState: add method canAmend"
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryState.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryState.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryState.java index 10170624b1..7c8f51d043 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryState.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryState.java @@ -60,6 +60,7 @@ public enum RepositoryState { public boolean canCheckout() { return false; } public boolean canResetHead() { return false; } public boolean canCommit() { return false; } + public boolean canAmend() { return false; } public String getDescription() { return "Bare"; } }, @@ -70,6 +71,7 @@ public enum RepositoryState { public boolean canCheckout() { return true; } public boolean canResetHead() { return true; } public boolean canCommit() { return true; } + public boolean canAmend() { return true; } public String getDescription() { return JGitText.get().repositoryState_normal; } }, @@ -79,6 +81,7 @@ public enum RepositoryState { public boolean canCheckout() { return false; } public boolean canResetHead() { return true; } public boolean canCommit() { return false; } + public boolean canAmend() { return false; } public String getDescription() { return JGitText.get().repositoryState_conflicts; } }, @@ -90,6 +93,7 @@ public enum RepositoryState { public boolean canCheckout() { return true; } public boolean canResetHead() { return true; } public boolean canCommit() { return true; } + public boolean canAmend() { return false; } public String getDescription() { return JGitText.get().repositoryState_merged; } }, @@ -99,6 +103,7 @@ public enum RepositoryState { public boolean canCheckout() { return false; } public boolean canResetHead() { return true; } public boolean canCommit() { return false; } + public boolean canAmend() { return false; } public String getDescription() { return JGitText.get().repositoryState_conflicts; } }, @@ -110,6 +115,7 @@ public enum RepositoryState { public boolean canCheckout() { return true; } public boolean canResetHead() { return true; } public boolean canCommit() { return true; } + public boolean canAmend() { return false; } public String getDescription() { return JGitText.get().repositoryState_merged; } }, @@ -120,6 +126,7 @@ public enum RepositoryState { public boolean canCheckout() { return false; } public boolean canResetHead() { return false; } public boolean canCommit() { return true; } + public boolean canAmend() { return true; } public String getDescription() { return JGitText.get().repositoryState_rebaseOrApplyMailbox; } }, @@ -130,6 +137,7 @@ public enum RepositoryState { public boolean canCheckout() { return false; } public boolean canResetHead() { return false; } public boolean canCommit() { return true; } + public boolean canAmend() { return true; } public String getDescription() { return JGitText.get().repositoryState_rebase; } }, @@ -140,6 +148,7 @@ public enum RepositoryState { public boolean canCheckout() { return false; } public boolean canResetHead() { return false; } public boolean canCommit() { return true; } + public boolean canAmend() { return true; } public String getDescription() { return JGitText.get().repositoryState_applyMailbox; } }, @@ -150,6 +159,7 @@ public enum RepositoryState { public boolean canCheckout() { return false; } public boolean canResetHead() { return false; } public boolean canCommit() { return true; } + public boolean canAmend() { return true; } public String getDescription() { return JGitText.get().repositoryState_rebaseWithMerge; } }, @@ -160,6 +170,7 @@ public enum RepositoryState { public boolean canCheckout() { return false; } public boolean canResetHead() { return false; } public boolean canCommit() { return true; } + public boolean canAmend() { return true; } public String getDescription() { return JGitText.get().repositoryState_rebaseInteractive; } }, @@ -176,6 +187,8 @@ public enum RepositoryState { /* Commit during bisect is useful */ public boolean canCommit() { return true; } + public boolean canAmend() { return false; } + public String getDescription() { return JGitText.get().repositoryState_bisecting; } }; @@ -195,6 +208,11 @@ public enum RepositoryState { public abstract boolean canResetHead(); /** + * @return true if amending is considered SAFE + */ + public abstract boolean canAmend(); + + /** * @return a human readable description of the state. */ public abstract String getDescription(); |