apply: make init_apply_state() return -1 instead of exit()ing

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

To do that in a compatible manner with the rest of the error handling
in "builtin/apply.c", init_apply_state() should return -1 instead of
calling exit().

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Christian Couder
2016-08-08 23:03:08 +02:00
committed by Junio C Hamano
parent bb493a5c14
commit 2f5a6d1218
3 changed files with 11 additions and 9 deletions

View File

@@ -102,9 +102,9 @@ extern int parse_whitespace_option(struct apply_state *state,
extern int parse_ignorewhitespace_option(struct apply_state *state,
const char *option);
extern void init_apply_state(struct apply_state *state,
const char *prefix,
struct lock_file *lock_file);
extern int init_apply_state(struct apply_state *state,
const char *prefix,
struct lock_file *lock_file);
extern void clear_apply_state(struct apply_state *state);
#endif