git/contrib/coccinelle/commit.cocci
Derrick Stolee b18ef13a3f coccinelle: update commit.cocci
A recent patch series renamed the get_commit_tree_from_graph method but
forgot to update the coccinelle script that exempted it from rules
regarding accesses to 'maybe_tree'. This fixes that oversight to bring
the coccinelle scripts back to a good state.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-16 10:54:31 -07:00

29 lines
470 B
Plaintext

@@
expression c;
@@
- &c->maybe_tree->object.oid
+ get_commit_tree_oid(c)
@@
expression c;
@@
- c->maybe_tree->object.oid.hash
+ get_commit_tree_oid(c)->hash
// These excluded functions must access c->maybe_tree direcly.
@@
identifier f !~ "^(get_commit_tree|get_commit_tree_in_graph_one|load_tree_for_commit)$";
expression c;
@@
f(...) {...
- c->maybe_tree
+ get_commit_tree(c)
...}
@@
expression c;
expression s;
@@
- get_commit_tree(c) = s
+ c->maybe_tree = s