diff options
author | Charley Wang | 2010-02-04 22:19:55 +0000 |
---|---|---|
committer | Matthias Sohn | 2010-02-04 22:43:01 +0000 |
commit | 354453cc5f3840f7d29bf961fc351c0d6bc8556c (patch) | |
tree | f2e2ce71a5e624656d99b6dcdc1e37637f0c7f32 | |
parent | 81529aace587c12c39807814f860622533b1a65c (diff) | |
download | egit-354453cc5f3840f7d29bf961fc351c0d6bc8556c.tar.gz egit-354453cc5f3840f7d29bf961fc351c0d6bc8556c.tar.xz egit-354453cc5f3840f7d29bf961fc351c0d6bc8556c.zip |
Stop prompting user to amend previous commit if no previous commits exist
Don't ask user if they want to amend a previous commit if no previous
commits exist.
Bug: 297265
Change-Id: Ib34b87e9c744a6256cf798e9a86c144fc77a61be
Signed-off-by: Charley Wang <chwang@redhat.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitAction.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitAction.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitAction.java index eb60f004da..d3e86e881a 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitAction.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitAction.java @@ -83,8 +83,9 @@ public class CommitAction extends RepositoryAction { } } + loadPreviousCommit(); if (files.isEmpty()) { - if (amendAllowed) { + if (amendAllowed && previousCommit != null) { boolean result = MessageDialog .openQuestion(getTargetPart().getSite().getShell(), "No files to commit", @@ -93,7 +94,7 @@ public class CommitAction extends RepositoryAction { return; amending = true; } else { - MessageDialog.openWarning(getTargetPart().getSite().getShell(), "No files to commit", "No changed items were selected.\n\nAmend is not possible as you have selected multiple repositories."); + MessageDialog.openWarning(getTargetPart().getSite().getShell(), "No files to commit", "Commit/amend not possible. Possible causes:\n\n- No changed items were selected\n- Multiple repositories selected\n- No repositories selected\n- No previous commits"); return; } } @@ -111,8 +112,6 @@ public class CommitAction extends RepositoryAction { committer = committer + " <" + committerEmail + ">"; //$NON-NLS-1$ //$NON-NLS-2$ } - loadPreviousCommit(); - CommitDialog commitDialog = new CommitDialog(getTargetPart().getSite().getShell()); commitDialog.setAmending(amending); commitDialog.setAmendAllowed(amendAllowed); |