Merge branch 'ml/doc-merge-updates' into maint-2.43
[alt-git.git] / builtin / apply.c
blobc18b7ea5d3da4aa66d82c9fa0e911274308ad598
1 #include "builtin.h"
2 #include "gettext.h"
3 #include "parse-options.h"
4 #include "repository.h"
5 #include "apply.h"
7 static const char * const apply_usage[] = {
8 N_("git apply [<options>] [<patch>...]"),
9 NULL
12 int cmd_apply(int argc, const char **argv, const char *prefix)
14 int force_apply = 0;
15 int options = 0;
16 int ret;
17 struct apply_state state;
19 if (init_apply_state(&state, the_repository, prefix))
20 exit(128);
22 argc = apply_parse_options(argc, argv,
23 &state, &force_apply, &options,
24 apply_usage);
26 if (check_apply_state(&state, force_apply))
27 exit(128);
29 ret = apply_all_patches(&state, argc, argv, options);
31 clear_apply_state(&state);
33 return ret;