@matheusbsbs / matheus-bagliano / commits / 53716a7bc9
Fork 0

git-gui: Start UI with the index locked.

Because we immediately start a rescan operation, but do so slightly delayed (by 1 ms, to let the UI show before we start forking off git processes), we can't let the user try to activate any of the restricted GUI commands before the 1 ms timer expires and we kick off the rescan. So now we lock the index before we enter the Tk event loop, ensuring that it is impossible for the user to inject a conflicting UI event before our rescan can begin. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Nov 18, 2006 at 03:31 UTC 53716a7bc94497cd6d2dfd53b1e4f7669d677b01
1 file changed +2 -1
git-gui
+2 -1
@@ -211,7 +211,7 @@ proc lock_index {type} {
211 uplevel #0 $w disabled
212 }
213 return 1
214 - } elseif {$index_lock_type eq {begin-update} && $type eq {update}} {
214 + } elseif {$index_lock_type eq "begin-$type"} {
215 set index_lock_type $type
216 return 1
217 }
@@ -2906,4 +2906,5 @@ if {!$single_commit} {
2906 populate_pull_menu .mbar.pull
2907 populate_push_menu .mbar.push
2908 }
2909 +lock_index begin-read
2910 after 1 do_rescan