1 #define USE_THE_REPOSITORY_VARIABLE
7 static const char * const apply_usage
[] = {
8 N_("git apply [<options>] [<patch>...]"),
12 int cmd_apply(int argc
,
15 struct repository
*repo UNUSED
)
20 struct apply_state state
;
22 if (init_apply_state(&state
, the_repository
, prefix
))
26 * We could to redo the "apply.c" machinery to make this
27 * arbitrary fallback unnecessary, but it is dubious that it
28 * is worth the effort.
29 * cf. https://lore.kernel.org/git/xmqqcypfcmn4.fsf@gitster.g/
32 repo_set_hash_algo(the_repository
, GIT_HASH_SHA1
);
34 argc
= apply_parse_options(argc
, argv
,
35 &state
, &force_apply
, &options
,
38 if (check_apply_state(&state
, force_apply
))
41 ret
= apply_all_patches(&state
, argc
, argv
, options
);
43 clear_apply_state(&state
);