summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Shawn O. Pearce <spearce@spearce.org>2007-01-21 13:22:26 -0500
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2007-01-21 22:47:54 -0500
commit6bdc929984f84318783ef320115f46151fa4f0d6 (patch)
treef5edb4c6dd9223bf800040d4f8609fc8bf00663e
parentgit-gui: Fix bug in unmerged file display. (diff)
downloadtgif-6bdc929984f84318783ef320115f46151fa4f0d6.tar.xz
git-gui: Clear diff from viewer if the side changed.
If the user switches the currently shown file from one side of the UI to the other then how its diff is presented would be different. And leaving the old diff up is downright confusing. Since the diff is probably not interesting to the user after the switch we should just clear the diff viewer. This saves the user time, as they won't need to wait for us to reload the diff. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rwxr-xr-xgit-gui.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 28c71c0b2d..c4d77fafe7 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -556,14 +556,17 @@ proc clear_diff {} {
}
proc reshow_diff {} {
- global ui_status_value file_states
+ global ui_status_value file_states file_lists
global current_diff_path current_diff_side
- if {$current_diff_path eq {}
- || [catch {set s $file_states($current_diff_path)}]} {
+ set p $current_diff_path
+ if {$p eq {}
+ || $current_diff_side eq {}
+ || [catch {set s $file_states($p)}]
+ || [lsearch -sorted $file_lists($current_diff_side) $p] == -1} {
clear_diff
} else {
- show_diff $current_diff_path $current_diff_side
+ show_diff $p $current_diff_side
}
}