]> git.ipfire.org Git - thirdparty/git.git/commit
cocci: fix incorrect & verbose "the_repository" rules
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 28 Mar 2023 13:58:43 +0000 (15:58 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Mar 2023 14:36:36 +0000 (07:36 -0700)
commit6f1436ba2a72bfcbeac9688fa7fe374870a49779
treeaa0bcd35b66d6c60af29538ce98c4ecd9083eb44
parent49c2d93ecf08b47698f9437372965b6f9d3af9fc
cocci: fix incorrect & verbose "the_repository" rules

When these rules started being added in [1] they didn't use a ";"
after the ")", and would thus catch uses of these macros within
expressions. But as of [2] the new additions were broken in that
they'd only match a subset of the users of these macros.

Rather than narrowly fixing that, let's have these use the much less
verbose pattern introduced in my recent [3]: There's no need to
exhaustively enumerate arguments if we use the "..." syntax. This
means that we can fold all of these different rules into one.

1. afd69dcc219 (object-store: prepare read_object_file to deal with
   any repo, 2018-11-13)
2. 21a9651ba3f (commit-reach: prepare get_merge_bases to handle any
   repo, 2018-11-13)
3. 0e6550a2c63 (cocci: add a index-compatibility.pending.cocci,
   2022-11-19)

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/coccinelle/the_repository.pending.cocci