summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/coccinelle/commit.cocci10
1 files changed, 4 insertions, 6 deletions
diff --git a/contrib/coccinelle/commit.cocci b/contrib/coccinelle/commit.cocci
index ac38525941..a7e9215ffc 100644
--- a/contrib/coccinelle/commit.cocci
+++ b/contrib/coccinelle/commit.cocci
@@ -10,11 +10,15 @@ 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|load_tree_for_commit)$";
expression c;
@@
+ f(...) {...
- c->maybe_tree
+ get_commit_tree(c)
+ ...}
@@
expression c;
@@ -22,9 +26,3 @@ expression s;
@@
- get_commit_tree(c) = s
+ c->maybe_tree = s
-
-@@
-expression c;
-@@
-- return get_commit_tree(c);
-+ return c->maybe_tree;