diff options
| author | Remy Suen | 2010-04-18 18:49:40 +0000 |
|---|---|---|
| committer | Chris Aniszczyk | 2010-04-20 14:52:06 +0000 |
| commit | 3236fe48a1b7b54124b6a11c187b3f1910a60e06 (patch) | |
| tree | 91a762fd02e1f895fa6680c3c1d97a8449850bb7 | |
| parent | cbcf8aa05b08802b0c8af5c6432d53789c3f928b (diff) | |
| download | egit-3236fe48a1b7b54124b6a11c187b3f1910a60e06.tar.gz egit-3236fe48a1b7b54124b6a11c187b3f1910a60e06.tar.xz egit-3236fe48a1b7b54124b6a11c187b3f1910a60e06.zip | |
Don't eagerly prompt the user with an error message when creating
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.java | 6 |
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 802922c382..632d339b53 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) |
