aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemy Suen2010-04-18 14:49:40 (EDT)
committerChris Aniszczyk2010-04-20 10:52:06 (EDT)
commit3236fe48a1b7b54124b6a11c187b3f1910a60e06 (patch)
tree91a762fd02e1f895fa6680c3c1d97a8449850bb7
parentcbcf8aa05b08802b0c8af5c6432d53789c3f928b (diff)
downloadegit-3236fe48a1b7b54124b6a11c187b3f1910a60e06.zip
egit-3236fe48a1b7b54124b6a11c187b3f1910a60e06.tar.gz
egit-3236fe48a1b7b54124b6a11c187b3f1910a60e06.tar.bz2
Don't eagerly prompt the user with an error message when creatingrefs/changes/80/580/2
or renaming a branch. It is bad form to prompt the user with an error message before they have actually entered any data. The input validator for the branch naming text field is too aggressive with its warning. It should only prompt when the user has actually entered data into the text field. Change-Id: I41e5ebd0e2c041a160fef13d31c6c7e9f98cabd1 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java
index 802922c..632d339 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java
@@ -293,6 +293,12 @@ public class BranchSelectionDialog extends Dialog {
prompt,
null, new IInputValidator() {
public String isValid(String newText) {
+ if (newText.length() == 0) {
+ // nothing entered, just don't let the user proceed,
+ // no need to prompt them with an error message
+ return ""; //$NON-NLS-1$
+ }
+
String testFor = Constants.R_HEADS + newText;
try {
if (repo.resolve(testFor) != null)