xdiff: ignore empty lines before added functions with -W
commit392f6d316623e8ecd6210248ba9ae2cabf07352b
authorRené Scharfe <l.s.r@web.de>
Sat, 28 May 2016 15:02:24 +0000 (28 17:02 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 31 May 2016 20:08:56 +0000 (31 13:08 -0700)
tree1991158ad53833e30253d96de495625b9173cf80
parent6d5badb2389d5d1d0752a230cd7ee74bb4043893
xdiff: ignore empty lines before added functions with -W

If a new function and a preceding empty line is appended, diff -W shows
the previous function in full in order to provide context for that empty
line.  In most languages empty lines between sections are not
interesting in and off themselves and showing a whole extra function for
them is not what we want.

Skip empty lines when checking of the appended chunk starts with a
function line, thereby avoiding to extend the context just for them.

Helped-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4051-diff-function-context.sh
xdiff/xemit.c