From 63aa1d0cb78e8fcf36ea2b8b65750d9a45d59f63 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Tue, 14 Oct 2008 13:48:37 +0200 Subject: [PATCH] git-gui: Do not munge conflict marker lines in a normal diff Previously, conflict markers were highlighted in two ways: (1) They received a distinguishing color; and (2) they had the '+' removed at the beginning of the line. However, by doing (2), a hunk that contained conflict markers could not be staged or unstaged because the resulting patch was corrupted. With this change we no longer modify the diff text of a 2-way diff, so that "Stage Hunk" and friends work. Note that 3-way diff of a conflicted file is unaffected by this change, and '++' before conflict markers is still removed. But this has no negative impact because in this mode staging hunks or lines is disabled anyway. Signed-off-by: Johannes Sixt Signed-off-by: Shawn O. Pearce --- lib/diff.tcl | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/diff.tcl b/lib/diff.tcl index bdcbbf86e..94ee38ccc 100644 --- a/lib/diff.tcl +++ b/lib/diff.tcl @@ -377,7 +377,6 @@ proc read_diff {fd cont_info} { {+} { if {[regexp {^\+([<>]{7} |={7})} $line _g op]} { set is_conflict_diff 1 - set line [string replace $line 0 0 { }] set tags d$op } else { set tags d_+ -- 2.26.2