From 5d3679ee023642825a5d3c0ca1eec251588a1848 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 7 Jan 2019 03:39:00 -0500 Subject: sha1-file: drop has_sha1_file() There are no callers left of has_sha1_file() or its with_flags() variant. Let's drop them, and convert has_object_file() from a wrapper into the "real" function. Ironically, the sha1 variant was just copying into an object_id internally, so the resulting code is actually shorter! We can also drop the coccinelle rules for catching has_sha1_file() callers. Since the function no longer exists, the compiler will do that for us. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- contrib/coccinelle/object_id.cocci | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'contrib') diff --git a/contrib/coccinelle/object_id.cocci b/contrib/coccinelle/object_id.cocci index 73886ae583..6a7cf3e02d 100644 --- a/contrib/coccinelle/object_id.cocci +++ b/contrib/coccinelle/object_id.cocci @@ -147,35 +147,3 @@ 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) - ...>} -- cgit v1.2.3