cocci: apply the "revision.h" part of "the_repository.pending"
Apply the part of "the_repository.pending.cocci" pertaining to "revision.h". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
b26a71b1be
commit
035c7de9e9
@ -551,7 +551,7 @@ static int get_modified_files(struct repository *r,
|
|||||||
opt.def = is_initial ?
|
opt.def = is_initial ?
|
||||||
empty_tree_oid_hex() : oid_to_hex(&head_oid);
|
empty_tree_oid_hex() : oid_to_hex(&head_oid);
|
||||||
|
|
||||||
init_revisions(&rev, NULL);
|
repo_init_revisions(the_repository, &rev, NULL);
|
||||||
setup_revisions(0, NULL, &rev, &opt);
|
setup_revisions(0, NULL, &rev, &opt);
|
||||||
|
|
||||||
rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;
|
rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;
|
||||||
|
@ -568,7 +568,7 @@ static int prepare_revs(struct bisect_terms *terms, struct rev_info *revs)
|
|||||||
* sets up a revision walk.
|
* sets up a revision walk.
|
||||||
*/
|
*/
|
||||||
reset_revision_walk();
|
reset_revision_walk();
|
||||||
init_revisions(revs, NULL);
|
repo_init_revisions(the_repository, revs, NULL);
|
||||||
setup_revisions(0, NULL, revs, NULL);
|
setup_revisions(0, NULL, revs, NULL);
|
||||||
for_each_glob_ref_in(add_bisect_ref, bad, "refs/bisect/", &cb);
|
for_each_glob_ref_in(add_bisect_ref, bad, "refs/bisect/", &cb);
|
||||||
cb.object_flags = UNINTERESTING;
|
cb.object_flags = UNINTERESTING;
|
||||||
@ -1095,7 +1095,7 @@ static enum bisect_error bisect_skip(struct bisect_terms *terms, int argc,
|
|||||||
struct rev_info revs;
|
struct rev_info revs;
|
||||||
struct commit *commit;
|
struct commit *commit;
|
||||||
|
|
||||||
init_revisions(&revs, NULL);
|
repo_init_revisions(the_repository, &revs, NULL);
|
||||||
setup_revisions(2, argv + i - 1, &revs, NULL);
|
setup_revisions(2, argv + i - 1, &revs, NULL);
|
||||||
|
|
||||||
if (prepare_revision_walk(&revs))
|
if (prepare_revision_walk(&revs))
|
||||||
|
@ -901,7 +901,7 @@ static int show_stash(int argc, const char **argv, const char *prefix)
|
|||||||
|
|
||||||
init_diff_ui_defaults();
|
init_diff_ui_defaults();
|
||||||
git_config(git_diff_ui_config, NULL);
|
git_config(git_diff_ui_config, NULL);
|
||||||
init_revisions(&rev, prefix);
|
repo_init_revisions(the_repository, &rev, prefix);
|
||||||
|
|
||||||
argc = parse_options(argc, argv, prefix, options, git_stash_show_usage,
|
argc = parse_options(argc, argv, prefix, options, git_stash_show_usage,
|
||||||
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN_OPT |
|
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN_OPT |
|
||||||
@ -1090,7 +1090,7 @@ static int check_changes_tracked_files(const struct pathspec *ps)
|
|||||||
if (repo_read_index(the_repository) < 0)
|
if (repo_read_index(the_repository) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
init_revisions(&rev, NULL);
|
repo_init_revisions(the_repository, &rev, NULL);
|
||||||
copy_pathspec(&rev.prune_data, ps);
|
copy_pathspec(&rev.prune_data, ps);
|
||||||
|
|
||||||
rev.diffopt.flags.quick = 1;
|
rev.diffopt.flags.quick = 1;
|
||||||
@ -1277,7 +1277,7 @@ static int stash_working_tree(struct stash_info *info, const struct pathspec *ps
|
|||||||
struct strbuf diff_output = STRBUF_INIT;
|
struct strbuf diff_output = STRBUF_INIT;
|
||||||
struct index_state istate = INDEX_STATE_INIT(the_repository);
|
struct index_state istate = INDEX_STATE_INIT(the_repository);
|
||||||
|
|
||||||
init_revisions(&rev, NULL);
|
repo_init_revisions(the_repository, &rev, NULL);
|
||||||
copy_pathspec(&rev.prune_data, ps);
|
copy_pathspec(&rev.prune_data, ps);
|
||||||
|
|
||||||
set_alternate_index_output(stash_index_path.buf);
|
set_alternate_index_output(stash_index_path.buf);
|
||||||
|
@ -1108,7 +1108,7 @@ static int compute_summary_module_list(struct object_id *head_oid,
|
|||||||
strvec_pushv(&diff_args, info->argv);
|
strvec_pushv(&diff_args, info->argv);
|
||||||
|
|
||||||
git_config(git_diff_basic_config, NULL);
|
git_config(git_diff_basic_config, NULL);
|
||||||
init_revisions(&rev, info->prefix);
|
repo_init_revisions(the_repository, &rev, info->prefix);
|
||||||
rev.abbrev = 0;
|
rev.abbrev = 0;
|
||||||
precompose_argv_prefix(diff_args.nr, diff_args.v, NULL);
|
precompose_argv_prefix(diff_args.nr, diff_args.v, NULL);
|
||||||
setup_revisions(diff_args.nr, diff_args.v, &rev, &opt);
|
setup_revisions(diff_args.nr, diff_args.v, &rev, &opt);
|
||||||
|
@ -113,6 +113,10 @@
|
|||||||
|
|
|
|
||||||
- rerere
|
- rerere
|
||||||
+ repo_rerere
|
+ repo_rerere
|
||||||
|
// revision.h
|
||||||
|
|
|
||||||
|
- init_revisions
|
||||||
|
+ repo_init_revisions
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
+ the_repository,
|
+ the_repository,
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
// This file is used for the ongoing refactoring of
|
|
||||||
// bringing the index or repository struct in all of
|
|
||||||
// our code base.
|
|
||||||
|
|
||||||
@@
|
|
||||||
@@
|
|
||||||
(
|
|
||||||
// revision.h
|
|
||||||
- init_revisions
|
|
||||||
+ repo_init_revisions
|
|
||||||
)
|
|
||||||
(
|
|
||||||
+ the_repository,
|
|
||||||
...)
|
|
@ -588,7 +588,7 @@ int is_range_diff_range(const char *arg)
|
|||||||
int i, positive = 0, negative = 0;
|
int i, positive = 0, negative = 0;
|
||||||
struct rev_info revs;
|
struct rev_info revs;
|
||||||
|
|
||||||
init_revisions(&revs, NULL);
|
repo_init_revisions(the_repository, &revs, NULL);
|
||||||
if (setup_revisions(3, argv, &revs, NULL) == 1) {
|
if (setup_revisions(3, argv, &revs, NULL) == 1) {
|
||||||
for (i = 0; i < revs.pending.nr; i++)
|
for (i = 0; i < revs.pending.nr; i++)
|
||||||
if (revs.pending.objects[i].item->flags & UNINTERESTING)
|
if (revs.pending.objects[i].item->flags & UNINTERESTING)
|
||||||
|
@ -415,9 +415,6 @@ struct rev_info {
|
|||||||
void repo_init_revisions(struct repository *r,
|
void repo_init_revisions(struct repository *r,
|
||||||
struct rev_info *revs,
|
struct rev_info *revs,
|
||||||
const char *prefix);
|
const char *prefix);
|
||||||
#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
|
|
||||||
#define init_revisions(revs, prefix) repo_init_revisions(the_repository, revs, prefix)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse revision information, filling in the `rev_info` structure, and
|
* Parse revision information, filling in the `rev_info` structure, and
|
||||||
|
Loading…
Reference in New Issue
Block a user