1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-09 13:46:08 +02:00
git/builtin/apply.c
Elijah Newren bc5c5ec044 cache.h: remove this no-longer-used header
Since this header showed up in some places besides just #include
statements, update/clean-up/remove those other places as well.

Note that compat/fsmonitor/fsm-path-utils-darwin.c previously got
away with violating the rule that all files must start with an include
of git-compat-util.h (or a short-list of alternate headers that happen
to include it first).  This change exposed the violation and caused it
to stop building correctly; fix it by having it include
git-compat-util.h first, as per policy.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21 13:39:53 -07:00

35 lines
682 B
C

#include "builtin.h"
#include "gettext.h"
#include "parse-options.h"
#include "repository.h"
#include "apply.h"
static const char * const apply_usage[] = {
N_("git apply [<options>] [<patch>...]"),
NULL
};
int cmd_apply(int argc, const char **argv, const char *prefix)
{
int force_apply = 0;
int options = 0;
int ret;
struct apply_state state;
if (init_apply_state(&state, the_repository, prefix))
exit(128);
argc = apply_parse_options(argc, argv,
&state, &force_apply, &options,
apply_usage);
if (check_apply_state(&state, force_apply))
exit(128);
ret = apply_all_patches(&state, argc, argv, options);
clear_apply_state(&state);
return ret;
}