summaryrefslogtreecommitdiff
path: root/git-gui
diff options
context:
space:
mode:
authorLibravatar Shawn O. Pearce <spearce@spearce.org>2006-11-18 03:31:25 -0500
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2006-11-18 03:31:25 -0500
commit53716a7bc94497cd6d2dfd53b1e4f7669d677b01 (patch)
tree548b34232b97c6981f06fa91d55ec449761d2721 /git-gui
parentgit-gui: Misc. comment formatting cleanups. (diff)
downloadtgif-53716a7bc94497cd6d2dfd53b1e4f7669d677b01.tar.xz
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>
Diffstat (limited to 'git-gui')
-rwxr-xr-xgit-gui3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-gui b/git-gui
index c2b4dd7067..4850e78ab0 100755
--- a/git-gui
+++ b/git-gui
@@ -211,7 +211,7 @@ proc lock_index {type} {
uplevel #0 $w disabled
}
return 1
- } elseif {$index_lock_type eq {begin-update} && $type eq {update}} {
+ } elseif {$index_lock_type eq "begin-$type"} {
set index_lock_type $type
return 1
}
@@ -2906,4 +2906,5 @@ if {!$single_commit} {
populate_pull_menu .mbar.pull
populate_push_menu .mbar.push
}
+lock_index begin-read
after 1 do_rescan