@matheusbsbs / matheus-bagliano / commits / 988b8a7d63
Fork 0

git-gui: Grab the index lock while running pull.

The user must not modify the index while a git pull operation is running, doing so might cause problems for the merge driver and specific strategy being used. Normally on the command line people are just really good and don't try to run index altering operations while they are also running a pull. But in a slick GUI like git-gui we can't trust the user quite as much. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Nov 7, 2006 at 21:30 UTC 988b8a7d63ff52f252bb4c517d9f05c3952aa728
1 file changed +2
git-gui
+2
@@ -642,6 +642,7 @@ proc fetch_from {remote} {
642 }
643
644 proc pull_remote {remote branch} {
645 + if {![lock_index update]} return
646 set w [new_console "pull $remote $branch" \
647 "Pulling new changes from branch $branch in $remote"]
648 set cmd [list git pull]
@@ -651,6 +652,7 @@ proc pull_remote {remote branch} {
652 }
653
654 proc post_pull_remote {remote branch success} {
655 + unlock_index
656 if {$success} {
657 update_status "Successfully pulled $branch from $remote."
658 } else {