]> git.ipfire.org Git - thirdparty/git.git/blobdiff - contrib/coccinelle/object_id.cocci
convert has_sha1_file() callers to has_object_file()
[thirdparty/git.git] / contrib / coccinelle / object_id.cocci
index 6a7cf3e02da832b3a2829178b968b57f3b80d081..73886ae5832e8dee5a0869009c7d9bddde76c008 100644 (file)
@@ -147,3 +147,35 @@ expression E1, E2;
 - hashcmp(E1, E2) != 0
 + !hasheq(E1, E2)
   ...>}
+
+@@
+struct object_id OID;
+@@
+- has_sha1_file(OID.hash)
++ has_object_file(&OID)
+
+@@
+identifier f != has_object_file;
+struct object_id *OIDPTR;
+@@
+  f(...) {<...
+- has_sha1_file(OIDPTR->hash)
++ has_object_file(OIDPTR)
+  ...>}
+
+@@
+struct object_id OID;
+expression E;
+@@
+- has_sha1_file_with_flags(OID.hash, E)
++ has_object_file_with_flags(&OID, E)
+
+@@
+identifier f != has_object_file_with_flags;
+struct object_id *OIDPTR;
+expression E;
+@@
+  f(...) {<...
+- has_sha1_file_with_flags(OIDPTR->hash, E)
++ has_object_file_with_flags(OIDPTR, E)
+  ...>}