xdiff: don't trim common tail with -W
commite0876bca4de44638a1cb51b03bdf0a40df631a80
authorRené Scharfe <l.s.r@web.de>
Sat, 28 May 2016 15:04:31 +0000 (28 17:04 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 31 May 2016 20:08:56 +0000 (31 13:08 -0700)
treeeb3fd50f21adb94deee1823a68467b43cb002e3b
parent9e6a4cfc38aa81055d0b7d6fb94dc7b31809daa9
xdiff: don't trim common tail with -W

The function trim_common_tail() exits early if context lines are
requested.  If -U0 and -W are specified together then it can still trim
context lines that might belong to a changed function.  As a result
that function is shown incompletely.

Fix that by calling trim_common_tail() only if no function context or
fixed context is requested.  The parameter ctx is no longer needed now;
remove it.

While at it fix an outdated comment as well.

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-interface.c