mirror of
https://github.com/git/git
synced 2024-10-30 14:03:28 +00:00
d1cbe1e6d8
hash.h depends upon and includes repository.h, due to the definition and use of the_hash_algo (defined as the_repository->hash_algo). However, most headers trying to include hash.h are only interested in the layout of the structs like object_id. Move the parts of hash.h that do not depend upon repository.h into a new file hash-ll.h (the "low level" parts of hash.h), and adjust other files to use this new header where the convenience inline functions aren't needed. This allows hash.h and object.h to be fairly small, minimal headers. It also exposes a lot of hidden dependencies on both path.h (which was brought in by repository.h) and repository.h (which was previously implicitly brought in by object.h), so also adjust other files to be more explicit about what they depend upon. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
35 lines
701 B
C
35 lines
701 B
C
#include "cache.h"
|
|
#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;
|
|
}
|