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