git-gui: Grab the index lock while running pull.
[gitweb.git] / git-gui
diff --git a/git-gui b/git-gui
index 8562983d36717f60061a0cae14e1c92fce422a25..2d82152b362f9b34722b88b72f64539da2380a16 100755 (executable)
--- a/git-gui
+++ b/git-gui
@@ -642,6 +642,7 @@ proc fetch_from {remote} {
 }
 
 proc pull_remote {remote branch} {
+       if {![lock_index update]} return
        set w [new_console "pull $remote $branch" \
                "Pulling new changes from branch $branch in $remote"]
        set cmd [list git pull]
@@ -651,6 +652,7 @@ proc pull_remote {remote branch} {
 }
 
 proc post_pull_remote {remote branch success} {
+       unlock_index
        if {$success} {
                update_status "Successfully pulled $branch from $remote."
        } else {