summaryrefslogtreecommitdiff
path: root/git-gui/git-gui--askpass
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-09-15 19:34:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-09-15 19:34:48 (GMT)
commit12644fa99fd16c33379c885670be0963cec07fc1 (patch)
treedcc24e83797accfe0f781011af4c318f7c855743 /git-gui/git-gui--askpass
parent5879b6bbcaba7696e4abfa717748da166f915405 (diff)
parent00e9de72c8f9b7c048bb56a59be9567d69dc1e01 (diff)
downloadgit-12644fa99fd16c33379c885670be0963cec07fc1.zip
git-12644fa99fd16c33379c885670be0963cec07fc1.tar.gz
git-12644fa99fd16c33379c885670be0963cec07fc1.tar.bz2
Merge git://repo.or.cz/git-gui
* 'master' of git://repo.or.cz/git-gui: git-gui 0.13 git-gui: avoid mis-encoding the copyright message on Windows. git-gui: Update Swedish translation (521t). git-gui: ensure correct application termination in git-gui--askpass git-gui: handle textconv filter on Windows and in development git-gui: use shell to launch textconv filter in "blame" git-gui: display error launching blame as a message box. git-gui: Make usage statement visible on Windows.
Diffstat (limited to 'git-gui/git-gui--askpass')
-rwxr-xr-xgit-gui/git-gui--askpass19
1 files changed, 13 insertions, 6 deletions
diff --git a/git-gui/git-gui--askpass b/git-gui/git-gui--askpass
index 12e117e..4277f30 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 . <Visibility> {focus -force .e}
-bind . <Key-Return> finish
-bind . <Key-Escape> {destroy .}
-bind . <Destroy> {exit $rc}
+bind . <Key-Return> [list .b.ok invoke]
+bind . <Key-Escape> [list .b.cancel invoke]
+bind . <Destroy> {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