]> git.ipfire.org Git - thirdparty/git.git/blame - builtin/apply.c
strmap: enable allocations to come from a mem_pool
[thirdparty/git.git] / builtin / apply.c
CommitLineData
c1bb9350 1#include "cache.h"
ac6245e3 2#include "builtin.h"
f26c4940 3#include "parse-options.h"
13b5af22 4#include "lockfile.h"
71501a71 5#include "apply.h"
2fc0f184 6
f26c4940 7static const char * const apply_usage[] = {
9c9b4f2f 8 N_("git apply [<options>] [<patch>...]"),
f26c4940
MV
9 NULL
10};
c1bb9350 11
91b769c4
CC
12int cmd_apply(int argc, const char **argv, const char *prefix)
13{
f26c4940 14 int force_apply = 0;
d1b27ced 15 int options = 0;
91b769c4 16 int ret;
2fc0f184 17 struct apply_state state;
c1bb9350 18
82ea77ec 19 if (init_apply_state(&state, the_repository, prefix))
2f5a6d12 20 exit(128);
67160271 21
7e1bad24
CC
22 argc = apply_parse_options(argc, argv,
23 &state, &force_apply, &options,
24 apply_usage);
4c8d4c14 25
f36538d8
CC
26 if (check_apply_state(&state, force_apply))
27 exit(128);
c536c075 28
91b769c4 29 ret = apply_all_patches(&state, argc, argv, options);
c1bb9350 30
6f27b941 31 clear_apply_state(&state);
edf2e370 32
91b769c4 33 return ret;
c1bb9350 34}