1
0
mirror of https://github.com/git/git.git synced 2025-04-11 08:56:12 +00:00

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>
This commit is contained in:
Shawn O. Pearce 2007-01-21 15:40:55 -05:00
parent 19e283f5c2
commit e754d6efe7

@ -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 \