summaryrefslogtreecommitdiff
path: root/git-gui
diff options
context:
space:
mode:
authorLibravatar Shawn O. Pearce <spearce@spearce.org>2006-11-12 18:22:59 -0500
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2006-11-13 00:10:39 -0500
commit2cbe5577a0e83ae7368eb2202ffe62c1d607b0bb (patch)
tree757a7855d222f2304e1e03c90cf5f4244d145639 /git-gui
parentgit-gui: Always use eq/ne for string comparsions. (diff)
downloadtgif-2cbe5577a0e83ae7368eb2202ffe62c1d607b0bb.tar.xz
git-gui: Reshow diff if we sent the file to update-index.
We can't ask the diff viewer to recompute the diff until after our update-index child process terminates, as the diff programs need to be able to read the updated index in order to generate the correct diff. This is actually why we prevent diffs from being generated while there is an update lock on the index, which is why we ignored our own show_diff invocation in the middle of the write_update_index event handler. So now we mark a flag if we identify that the file currently in the diff viewer was also sent to update-index; then later when the update-index process has terminated we update the diff viewer if the flag is true. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui')
-rwxr-xr-xgit-gui13
1 files changed, 9 insertions, 4 deletions
diff --git a/git-gui b/git-gui
index 05ef8e2e33..fdb82812bd 100755
--- a/git-gui
+++ b/git-gui
@@ -1143,11 +1143,12 @@ proc display_all_files {} {
}
proc update_index {pathList} {
- global update_index_cp ui_status_value
+ global update_index_cp update_index_rsd ui_status_value
if {![lock_index update]} return
set update_index_cp 0
+ set update_index_rsd 0
set totalCnt [llength $pathList]
set batch [expr {int($totalCnt * .01) + 1}]
if {$batch > 25} {set batch 25}
@@ -1170,13 +1171,17 @@ proc update_index {pathList} {
}
proc write_update_index {fd pathList totalCnt batch} {
- global update_index_cp ui_status_value
+ global update_index_cp update_index_rsd ui_status_value
global file_states ui_fname_value
if {$update_index_cp >= $totalCnt} {
close $fd
unlock_index
- set ui_status_value {Ready.}
+ if {$update_index_rsd} {
+ show_diff $ui_fname_value
+ } else {
+ set ui_status_value {Ready.}
+ }
return
}
@@ -1200,7 +1205,7 @@ proc write_update_index {fd pathList totalCnt batch} {
puts -nonewline $fd "\0"
display_file $path $new
if {$ui_fname_value eq $path} {
- show_diff $path
+ set update_index_rsd 1
}
}