Skip to content

Commit 63aa1d0

Browse files
Johannes Sixtspearce
authored andcommitted
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 <[email protected]> Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent 8c76212 commit 63aa1d0

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

lib/diff.tcl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ proc read_diff {fd cont_info} {
377377
{+} {
378378
if {[regexp {^\+([<>]{7} |={7})} $line _g op]} {
379379
set is_conflict_diff 1
380-
set line [string replace $line 0 0 { }]
381380
set tags d$op
382381
} else {
383382
set tags d_+

0 commit comments

Comments
 (0)