builtin/apply: make parse_single_patch() return -1 on error
commitdae197f753c8b3ccdc9c97cfc04f0dbd99a5cc3c
authorChristian Couder <christian.couder@gmail.com>
Mon, 8 Aug 2016 21:03:04 +0000 (8 23:03 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Aug 2016 19:41:46 +0000 (11 12:41 -0700)
tree7d92b1e485763ec180831f1f7b0e211effbefaf4
parentb654b34c1cf877709febb602991f46e7ba0d947d
builtin/apply: make parse_single_patch() return -1 on error

To libify `git apply` functionality we have to signal errors to the
caller instead of die()ing.

To do that in a compatible manner with the rest of the error handling
in builtin/apply.c, parse_single_patch() should return a negative
integer instead of calling die().

Let's do that by using error() and let's adjust the related test
cases accordingly.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/apply.c
t/t4012-diff-binary.sh