builtin/apply: move init_apply_state() to apply.c

To libify `git apply` functionality we must make init_apply_state()
usable outside "builtin/apply.c".

Let's do that by moving it into a new "apply.c".

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
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:07 +02:00
committed by Junio C Hamano
parent f95fdc256b
commit bb493a5c14
4 changed files with 105 additions and 91 deletions

10
apply.h
View File

@ -97,4 +97,14 @@ struct apply_state {
int applied_after_fixing_ws;
};
extern int parse_whitespace_option(struct apply_state *state,
const char *option);
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 void clear_apply_state(struct apply_state *state);
#endif