diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2008-11-16 21:46:48 +0300 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2008-11-16 13:33:09 -0800 |
commit | 7cf4566f48b7f17c68ab215a9ca6ef7792d9d791 (patch) | |
tree | 324461a7369958c83b0d8d0486b5354597501bfa /lib | |
parent | git-gui: Implement system-wide configuration handling. (diff) | |
download | tgif-7cf4566f48b7f17c68ab215a9ca6ef7792d9d791.tar.xz |
git-gui: Fix the after callback execution in rescan.
The rescan function receives a callback command
as its parameter, which is supposed to be executed
after the scan finishes. It is generally used to
update status. However, rescan may initiate a
loading of a diff, which always calls ui_ready after
completion. If the after handler is called before
that, ui_ready will override the new status.
This commit ensures that the after callback is
properly threaded through the diff machinery.
Since it uncovered the fact that force_first_diff
actually didn't work due to an undeclared global
variable, and the desired effects appeared only
because of the race condition between the diff
system and the rescan callback, I also reimplement
this function to make it behave as originally
intended.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/diff.tcl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/diff.tcl b/lib/diff.tcl index 94ee38cccc..bbbf15c875 100644 --- a/lib/diff.tcl +++ b/lib/diff.tcl @@ -16,7 +16,7 @@ proc clear_diff {} { $ui_workdir tag remove in_diff 0.0 end } -proc reshow_diff {} { +proc reshow_diff {{after {}}} { global file_states file_lists global current_diff_path current_diff_side global ui_diff @@ -30,13 +30,13 @@ proc reshow_diff {} { || [lsearch -sorted -exact $file_lists($current_diff_side) $p] == -1} { if {[find_next_diff $current_diff_side $p {} {[^O]}]} { - next_diff + next_diff $after } else { clear_diff } } else { set save_pos [lindex [$ui_diff yview] 0] - show_diff $p $current_diff_side {} $save_pos + show_diff $p $current_diff_side {} $save_pos $after } } |