builtin/apply: make gitdiff_*() return 1 at end of header
commit70af7662d47ac9f450c248720a379a8db817163b
authorChristian Couder <christian.couder@gmail.com>
Mon, 8 Aug 2016 21:03:13 +0000 (8 23:03 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Aug 2016 19:41:47 +0000 (11 12:41 -0700)
tree2d0992558385f0a40cde5d4d877dcc0b4b50f4b8
parent9724e6ff48506323ab897e2d9f8d27febd4d9bb0
builtin/apply: make gitdiff_*() return 1 at end of header

The gitdiff_*() functions that are called as p->fn() in parse_git_header()
should return 1 instead of -1 in case of end of header or unrecognized
input, as these are not real errors. It just instructs the parser to break
out.

This makes it possible for gitdiff_*() functions to return -1 in case of a
real error. This will be done in a following patch.

Helped-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/apply.c