X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-gui%2Fgit-gui--askpass;h=4277f30c4116faf2788243af4ec23f1d077698e8;hb=b3f66fd3e3abeb9183f33f023727e3a53868849d;hp=12e117ecb11afabef1d0d751ebee442ce515dc1e;hpb=66fd74ea5db13e6f095f7c414e9ea4a1aa59cdc7;p=git.git diff --git a/git-gui/git-gui--askpass b/git-gui/git-gui--askpass index 12e117ecb..4277f30c4 100755 --- a/git-gui/git-gui--askpass +++ b/git-gui/git-gui--askpass @@ -5,6 +5,8 @@ exec wish "$0" -- "$@" # This is a trivial implementation of an SSH_ASKPASS handler. # Git-gui uses this script if none are already configured. +package require Tk + set answer {} set yesno 0 set rc 255 @@ -30,16 +32,20 @@ if {!$yesno} { frame .b button .b.ok -text OK -command finish -button .b.cancel -text Cancel -command {destroy .} +button .b.cancel -text Cancel -command cancel pack .b.ok -side left -expand 1 pack .b.cancel -side right -expand 1 pack .b -side bottom -fill x -padx 10 -pady 10 bind . {focus -force .e} -bind . finish -bind . {destroy .} -bind . {exit $rc} +bind . [list .b.ok invoke] +bind . [list .b.cancel invoke] +bind . {set rc $rc} + +proc cancel {} { + set ::rc 255 +} proc finish {} { if {$::yesno} { @@ -50,10 +56,11 @@ proc finish {} { } } - set ::rc 0 puts $::answer - destroy . + set ::rc 0 } wm title . "OpenSSH" tk::PlaceWindow . +vwait rc +exit $rc