@matheusbsbs / matheus-bagliano / commits / d1c7f8aa66
Fork 0

git-gui: handle special content lines only in the diff header section

These two also stop the diff header. Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

Bert Wesarg committed Dec 9, 2010 at 21:47 UTC d1c7f8aa666dfc96743782cba452112c7678e9eb
1 file changed +9 -6
lib/diff.tcl
+9 -6
@@ -400,7 +400,14 @@ proc read_diff {fd conflict_size cont_info} {
400 if {[string match {@@@ *} $line]} {set is_3way_diff 1}
401
402 if {$::current_diff_inheader} {
403 - append current_diff_header $line "\n"
403 +
404 + # -- These two lines stop a diff header and shouldn't be in there
405 + if { [string match {Binary files * and * differ} $line]
406 + || [regexp {^\* Unmerged path } $line]} {
407 + set ::current_diff_inheader 0
408 + } else {
409 + append current_diff_header $line "\n"
410 + }
411
412 # -- Cleanup uninteresting diff header lines.
413 #
@@ -418,16 +425,12 @@ proc read_diff {fd conflict_size cont_info} {
425 regsub {^(deleted|new) file mode 120000} $line {\1 symlink} line
426 }
427
421 -
422 -
428 if {[string match {new file *} $line]
429 || [regexp {^(old|new) mode *} $line]
430 || [string match {deleted file *} $line]
431 || [string match {deleted symlink} $line]
432 || [string match {new symlink} $line]
428 - || [string match {Binary files * and * differ} $line]
429 - || $line eq {\ No newline at end of file}
430 - || [regexp {^\* Unmerged path } $line]} {
433 + || $line eq {\ No newline at end of file}} {
434 } elseif {$is_3way_diff} {
435 set op [string range $line 0 1]
436 switch -- $op {