diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2007-01-21 13:18:11 -0500 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2007-01-21 22:47:54 -0500 |
commit | 079d0d5057dd66916c8d23802d48b19235fedf09 (patch) | |
tree | 71bf16585428a9114ca99eef212c61894faeb41e | |
parent | git-gui: Improve diff --cc viewing for unmerged files. (diff) | |
download | tgif-079d0d5057dd66916c8d23802d48b19235fedf09.tar.xz |
git-gui: Fix bug in unmerged file display.
We were not correctly setting the old state of an index display to
_ if the index was previously unmerged. This caused us to try and
update a U->M when resolving a merge conflict but we were unable to
do so as the icon did not exist in the index viewer. Tk did not
like being asked to modify an icon which was undefined.
Now we always transform both the old and the new states for both
sides (index and working directory) prior to updating the UI.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rwxr-xr-x | git-gui.sh | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/git-gui.sh b/git-gui.sh index 5463bb98ae..28c71c0b2d 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -1320,20 +1320,27 @@ proc display_file {path state} { set new_m [lindex $s 0] set icon_name [lindex $s 1] - set s [string index $new_m 0] - if {$s eq {U}} { - set s _ + set o [string index $old_m 0] + set n [string index $new_m 0] + if {$o eq {U}} { + set o _ } - display_file_helper $ui_index $path $icon_name \ - [string index $old_m 0] $s + if {$n eq {U}} { + set n _ + } + display_file_helper $ui_index $path $icon_name $o $n + if {[string index $old_m 0] eq {U}} { + set o U + } else { + set o [string index $old_m 0] + } if {[string index $new_m 0] eq {U}} { - set s U + set n U } else { - set s [string index $new_m 1] + set n [string index $new_m 1] } - display_file_helper $ui_workdir $path $icon_name \ - [string index $old_m 1] $s + display_file_helper $ui_workdir $path $icon_name $o $n if {$new_m eq {__}} { unset file_states($path) |