]> git.ipfire.org Git - thirdparty/git.git/blob - builtin/apply.c
Merge branch 'rs/parse-options-with-keep-unknown-abbrev-fix'
[thirdparty/git.git] / builtin / apply.c
1 #include "builtin.h"
2 #include "gettext.h"
3 #include "repository.h"
4 #include "apply.h"
5
6 static const char * const apply_usage[] = {
7 N_("git apply [<options>] [<patch>...]"),
8 NULL
9 };
10
11 int cmd_apply(int argc, const char **argv, const char *prefix)
12 {
13 int force_apply = 0;
14 int options = 0;
15 int ret;
16 struct apply_state state;
17
18 if (init_apply_state(&state, the_repository, prefix))
19 exit(128);
20
21 argc = apply_parse_options(argc, argv,
22 &state, &force_apply, &options,
23 apply_usage);
24
25 if (check_apply_state(&state, force_apply))
26 exit(128);
27
28 ret = apply_all_patches(&state, argc, argv, options);
29
30 clear_apply_state(&state);
31
32 return ret;
33 }