Skip to content

Commit 0853903

Browse files
avargitster
authored andcommitted
cocci: apply the "diff.h" part of "the_repository.pending"
Apply the part of "the_repository.pending.cocci" pertaining to "diff.h". Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ecb5091 commit 0853903

File tree

8 files changed

+9
-12
lines changed

8 files changed

+9
-12
lines changed

builtin/log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,7 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file,
13711371
.other_arg = &other_arg
13721372
};
13731373

1374-
diff_setup(&opts);
1374+
repo_diff_setup(the_repository, &opts);
13751375
opts.file = rev->diffopt.file;
13761376
opts.use_color = rev->diffopt.use_color;
13771377
diff_setup_done(&opts);

builtin/rebase.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
17861786
}
17871787

17881788
/* We want color (if set), but no pager */
1789-
diff_setup(&opts);
1789+
repo_diff_setup(the_repository, &opts);
17901790
opts.stat_width = -1; /* use full terminal width */
17911791
opts.stat_graph_width = -1; /* respect statGraphWidth config */
17921792
opts.output_format |=

builtin/stash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ static void unstage_changes_unless_new(struct object_id *orig_tree)
427427
* to the index before a merge was run) and the current index
428428
* (reflecting the changes brought in by the merge).
429429
*/
430-
diff_setup(&diff_opts);
430+
repo_diff_setup(the_repository, &diff_opts);
431431
diff_opts.flags.recursive = 1;
432432
diff_opts.detect_rename = 0;
433433
diff_opts.output_format = DIFF_FORMAT_NO_OUTPUT;

contrib/coccinelle/the_repository.cocci

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@
7373
|
7474
- get_commit_tree
7575
+ repo_get_commit_tree
76+
// diff.h
77+
|
78+
- diff_setup
79+
+ repo_diff_setup
7680
)
7781
(
7882
+ the_repository,

contrib/coccinelle/the_repository.pending.cocci

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
@@
66
@@
77
(
8-
// diff.h
9-
- diff_setup
10-
+ repo_diff_setup
118
// object-store.h
12-
|
139
- read_object_file
1410
+ repo_read_object_file
1511
|

diff.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,6 @@ int git_diff_basic_config(const char *var, const char *value, void *cb);
535535
int git_diff_heuristic_config(const char *var, const char *value, void *cb);
536536
void init_diff_ui_defaults(void);
537537
int git_diff_ui_config(const char *var, const char *value, void *cb);
538-
#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
539-
#define diff_setup(diffopts) repo_diff_setup(the_repository, diffopts)
540-
#endif
541538
void repo_diff_setup(struct repository *, struct diff_options *);
542539
struct option *add_diff_options(const struct option *, struct diff_options *);
543540
int diff_opt_parse(struct diff_options *, const char **, int, const char *);

log-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ void show_log(struct rev_info *opt)
849849
* Pass minimum required diff-options to range-diff; others
850850
* can be added later if deemed desirable.
851851
*/
852-
diff_setup(&opts);
852+
repo_diff_setup(the_repository, &opts);
853853
opts.file = opt->diffopt.file;
854854
opts.use_color = opt->diffopt.use_color;
855855
diff_setup_done(&opts);

range-diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ static void output(struct string_list *a, struct string_list *b,
485485
if (range_diff_opts->diffopt)
486486
memcpy(&opts, range_diff_opts->diffopt, sizeof(opts));
487487
else
488-
diff_setup(&opts);
488+
repo_diff_setup(the_repository, &opts);
489489

490490
opts.no_free = 1;
491491
if (!opts.output_format)

0 commit comments

Comments
 (0)