apply: check git diffs for mutually exclusive header lines
commitd70e9c5c8c865626b6e69c2bf9fd0e368543617b
authorRené Scharfe <l.s.r@web.de>
Tue, 27 Jun 2017 17:03:39 +0000 (27 19:03 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 Jun 2017 21:41:10 +0000 (27 14:41 -0700)
tree309b7e2255b5467662d3f3b43f74a369469a874d
parent44e5471a8d8ec5f04058220f8b91513b5b5accaa
apply: check git diffs for mutually exclusive header lines

A file can either be added, removed, copied, or renamed, but no two of
these actions can be done by the same patch.  Some of these combinations
provoke error messages due to missing file names, and some are only
caught by an assertion.  Check git patches already as they are parsed
and report conflicting lines on sight.

Found by Vegard Nossum using AFL.

Reported-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
apply.c
t/t4136-apply-check.sh