git-gui: Unlock the index when cancelling merge dialog
authorShawn O. Pearce <spearce@spearce.org>
Wed, 4 Jul 2007 06:29:32 +0000 (02:29 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 4 Jul 2007 06:29:32 +0000 (02:29 -0400)
Pressing the escape key while in the merge dialog cancels the merge
and correctly unlocks the index. Unfortunately this is not true of
the Cancel button, using it closes the dialog but does not release
the index lock, rendering git-gui frozen until you restart it. We
now properly release the index lock when the Cancel button is used.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
lib/merge.tcl
index ae0389df5bfb13b2823720c241b861b7b36b9e95..889182f5454ac0f636fc57c31a16331c097b0c71 100644 (file)
@@ -213,7 +213,9 @@ proc dialog {} {
        pack $w.buttons.visualize -side left
        button $w.buttons.create -text Merge -command $_start
        pack $w.buttons.create -side right
        pack $w.buttons.visualize -side left
        button $w.buttons.create -text Merge -command $_start
        pack $w.buttons.create -side right
-       button $w.buttons.cancel -text {Cancel} -command [list destroy $w]
+       button $w.buttons.cancel \
+               -text {Cancel} \
+               -command "unlock_index;destroy $w"
        pack $w.buttons.cancel -side right -padx 5
        pack $w.buttons -side bottom -fill x -pady 10 -padx 10
 
        pack $w.buttons.cancel -side right -padx 5
        pack $w.buttons -side bottom -fill x -pady 10 -padx 10