Merge branch 'jk/am-i-resolved-fix'
[git] / contrib / coccinelle / commit.cocci
1 @@
2 expression c;
3 @@
4 - &c->maybe_tree->object.oid
5 + get_commit_tree_oid(c)
6
7 @@
8 expression c;
9 @@
10 - c->maybe_tree->object.oid.hash
11 + get_commit_tree_oid(c)->hash
12
13 @@
14 identifier f !~ "^set_commit_tree$";
15 expression c;
16 expression s;
17 @@
18   f(...) {<...
19 - c->maybe_tree = s
20 + set_commit_tree(c, s)
21   ...>}
22
23 // These excluded functions must access c->maybe_tree direcly.
24 // Note that if c->maybe_tree is written somewhere outside of these
25 // functions, then the recommended transformation will be bogus with
26 // repo_get_commit_tree() on the LHS.
27 @@
28 identifier f !~ "^(repo_get_commit_tree|get_commit_tree_in_graph_one|load_tree_for_commit|set_commit_tree)$";
29 expression c;
30 @@
31   f(...) {<...
32 - c->maybe_tree
33 + repo_get_commit_tree(specify_the_right_repo_here, c)
34   ...>}