summaryrefslogtreecommitdiff
path: root/object-store.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-01-07 03:39:00 -0500
committerJunio C Hamano <gitster@pobox.com>2019-01-08 09:41:06 -0800
commit5d3679ee023642825a5d3c0ca1eec251588a1848 (patch)
treeb62b740259f8dfd219d25833be65ff675eddc2cc /object-store.h
parent98374a07c98d1acc200c423b87495365a59cce0b (diff)
downloadgit-5d3679ee023642825a5d3c0ca1eec251588a1848.tar.gz
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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object-store.h')
-rw-r--r--object-store.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/object-store.h b/object-store.h
index 139feb75b2..a7808bb624 100644
--- a/object-store.h
+++ b/object-store.h
@@ -202,20 +202,16 @@ int read_loose_object(const char *path,
void **contents);
/*
- * Convenience for sha1_object_info_extended() with a NULL struct
+ * Convenience for oid_object_info_extended() with a NULL struct
* object_info. OBJECT_INFO_SKIP_CACHED is automatically set; pass
* nonzero flags to also set other flags.
*/
-extern int has_sha1_file_with_flags(const unsigned char *sha1, int flags);
-static inline int has_sha1_file(const unsigned char *sha1)
+int has_object_file_with_flags(const struct object_id *oid, int flags);
+static inline int has_object_file(const struct object_id *oid)
{
- return has_sha1_file_with_flags(sha1, 0);
+ return has_object_file_with_flags(oid, 0);
}
-/* Same as the above, except for struct object_id. */
-extern int has_object_file(const struct object_id *oid);
-extern int has_object_file_with_flags(const struct object_id *oid, int flags);
-
/*
* Return true iff an alternate object database has a loose object
* with the specified name. This function does not respect replace