Skip to content

Commit 035c7de

Browse files
avargitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b26a71b commit 035c7de

File tree

8 files changed

+12
-25
lines changed

8 files changed

+12
-25
lines changed

add-interactive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ static int get_modified_files(struct repository *r,
551551
opt.def = is_initial ?
552552
empty_tree_oid_hex() : oid_to_hex(&head_oid);
553553

554-
init_revisions(&rev, NULL);
554+
repo_init_revisions(the_repository, &rev, NULL);
555555
setup_revisions(0, NULL, &rev, &opt);
556556

557557
rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;

builtin/bisect.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ static int prepare_revs(struct bisect_terms *terms, struct rev_info *revs)
568568
* sets up a revision walk.
569569
*/
570570
reset_revision_walk();
571-
init_revisions(revs, NULL);
571+
repo_init_revisions(the_repository, revs, NULL);
572572
setup_revisions(0, NULL, revs, NULL);
573573
for_each_glob_ref_in(add_bisect_ref, bad, "refs/bisect/", &cb);
574574
cb.object_flags = UNINTERESTING;
@@ -1095,7 +1095,7 @@ static enum bisect_error bisect_skip(struct bisect_terms *terms, int argc,
10951095
struct rev_info revs;
10961096
struct commit *commit;
10971097

1098-
init_revisions(&revs, NULL);
1098+
repo_init_revisions(the_repository, &revs, NULL);
10991099
setup_revisions(2, argv + i - 1, &revs, NULL);
11001100

11011101
if (prepare_revision_walk(&revs))

builtin/stash.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ static int show_stash(int argc, const char **argv, const char *prefix)
901901

902902
init_diff_ui_defaults();
903903
git_config(git_diff_ui_config, NULL);
904-
init_revisions(&rev, prefix);
904+
repo_init_revisions(the_repository, &rev, prefix);
905905

906906
argc = parse_options(argc, argv, prefix, options, git_stash_show_usage,
907907
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN_OPT |
@@ -1090,7 +1090,7 @@ static int check_changes_tracked_files(const struct pathspec *ps)
10901090
if (repo_read_index(the_repository) < 0)
10911091
return -1;
10921092

1093-
init_revisions(&rev, NULL);
1093+
repo_init_revisions(the_repository, &rev, NULL);
10941094
copy_pathspec(&rev.prune_data, ps);
10951095

10961096
rev.diffopt.flags.quick = 1;
@@ -1277,7 +1277,7 @@ static int stash_working_tree(struct stash_info *info, const struct pathspec *ps
12771277
struct strbuf diff_output = STRBUF_INIT;
12781278
struct index_state istate = INDEX_STATE_INIT(the_repository);
12791279

1280-
init_revisions(&rev, NULL);
1280+
repo_init_revisions(the_repository, &rev, NULL);
12811281
copy_pathspec(&rev.prune_data, ps);
12821282

12831283
set_alternate_index_output(stash_index_path.buf);

builtin/submodule--helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ static int compute_summary_module_list(struct object_id *head_oid,
11081108
strvec_pushv(&diff_args, info->argv);
11091109

11101110
git_config(git_diff_basic_config, NULL);
1111-
init_revisions(&rev, info->prefix);
1111+
repo_init_revisions(the_repository, &rev, info->prefix);
11121112
rev.abbrev = 0;
11131113
precompose_argv_prefix(diff_args.nr, diff_args.v, NULL);
11141114
setup_revisions(diff_args.nr, diff_args.v, &rev, &opt);

contrib/coccinelle/the_repository.cocci

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@
113113
|
114114
- rerere
115115
+ repo_rerere
116+
// revision.h
117+
|
118+
- init_revisions
119+
+ repo_init_revisions
116120
)
117121
(
118122
+ the_repository,

contrib/coccinelle/the_repository.pending.cocci

Lines changed: 0 additions & 14 deletions
This file was deleted.

range-diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ int is_range_diff_range(const char *arg)
588588
int i, positive = 0, negative = 0;
589589
struct rev_info revs;
590590

591-
init_revisions(&revs, NULL);
591+
repo_init_revisions(the_repository, &revs, NULL);
592592
if (setup_revisions(3, argv, &revs, NULL) == 1) {
593593
for (i = 0; i < revs.pending.nr; i++)
594594
if (revs.pending.objects[i].item->flags & UNINTERESTING)

revision.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,6 @@ struct rev_info {
415415
void repo_init_revisions(struct repository *r,
416416
struct rev_info *revs,
417417
const char *prefix);
418-
#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
419-
#define init_revisions(revs, prefix) repo_init_revisions(the_repository, revs, prefix)
420-
#endif
421418

422419
/**
423420
* Parse revision information, filling in the `rev_info` structure, and

0 commit comments

Comments
 (0)