return error(_("unrecognized whitespace ignore option '%s'"), option);
}
-void init_apply_state(struct apply_state *state,
- const char *prefix,
- struct lock_file *lock_file)
+int init_apply_state(struct apply_state *state,
+ const char *prefix,
+ struct lock_file *lock_file)
{
memset(state, 0, sizeof(*state));
state->prefix = prefix;
git_apply_config();
if (apply_default_whitespace && parse_whitespace_option(state, apply_default_whitespace))
- exit(1);
+ return -1;
if (apply_default_ignorewhitespace && parse_ignorewhitespace_option(state, apply_default_ignorewhitespace))
- exit(1);
+ return -1;
+ return 0;
}
void clear_apply_state(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
OPT_END()
};
- init_apply_state(&state, prefix, &lock_file);
+ if (init_apply_state(&state, prefix, &lock_file))
+ exit(128);
argc = parse_options(argc, argv, state.prefix, builtin_apply_options,
apply_usage, 0);