1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-09 14:56:07 +02:00
git/builtin/apply.c
Elijah Newren f394e093df treewide: be explicit about dependence on gettext.h
Dozens of files made use of gettext functions, without explicitly
including gettext.h.  This made it more difficult to find which files
could remove a dependence on cache.h.  Make C files explicitly include
gettext.h if they are using it.

However, while compat/fsmonitor/fsm-ipc-darwin.c should also gain an
include of gettext.h, it was left out to avoid conflicting with an
in-flight topic.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-21 10:56:51 -07:00

35 lines
677 B
C

#include "cache.h"
#include "builtin.h"
#include "gettext.h"
#include "parse-options.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;
}