summaryrefslogtreecommitdiff
path: root/git-gui.sh
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-01-21 15:40:55 -0500
committerShawn O. Pearce <spearce@spearce.org>2007-01-21 22:47:57 -0500
commite754d6efe7810f5f2c6cbd48dca21f1bc84a6a5e (patch)
tree4ab5ce5a55e2c4cdb207d7a6532885c5eb80bff4 /git-gui.sh
parent19e283f5c25b64a55fca099342f9bebddef4e17e (diff)
downloadgit-e754d6efe7810f5f2c6cbd48dca21f1bc84a6a5e.tar.xz
git-gui: Give a better error message on an empty branch name.
New branches must have a name. An empty one is not a valid ref, but the generic message "We do not like '' as a branch name." is just too vague or difficult to read. So detect the missing name early and tell the user it must be entered. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui.sh')
-rwxr-xr-xgit-gui.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/git-gui.sh b/git-gui.sh
index c4ab824b9d..0f98d2ccea 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -1696,6 +1696,16 @@ proc do_create_branch_action {w} {
global create_branch_head create_branch_trackinghead
set newbranch [string trim [$w.desc.name_t get 0.0 end]]
+ if {$newbranch eq {}} {
+ tk_messageBox \
+ -icon error \
+ -type ok \
+ -title [wm title $w] \
+ -parent $w \
+ -message "Please supply a branch name."
+ focus $w.desc.name_t
+ return
+ }
if {![catch {exec git show-ref --verify -- "refs/heads/$newbranch"}]} {
tk_messageBox \
-icon error \