summaryrefslogtreecommitdiff
path: root/sha1-file.c
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 /sha1-file.c
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 'sha1-file.c')
-rw-r--r--sha1-file.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/sha1-file.c b/sha1-file.c
index 95186c019a..0d926e3c13 100644
--- a/sha1-file.c
+++ b/sha1-file.c
@@ -1752,26 +1752,14 @@ int force_object_loose(const struct object_id *oid, time_t mtime)
return ret;
}
-int has_sha1_file_with_flags(const unsigned char *sha1, int flags)
+int has_object_file_with_flags(const struct object_id *oid, int flags)
{
- struct object_id oid;
if (!startup_info->have_repository)
return 0;
- hashcpy(oid.hash, sha1);
- return oid_object_info_extended(the_repository, &oid, NULL,
+ return oid_object_info_extended(the_repository, oid, NULL,
flags | OBJECT_INFO_SKIP_CACHED) >= 0;
}
-int has_object_file(const struct object_id *oid)
-{
- return has_sha1_file(oid->hash);
-}
-
-int has_object_file_with_flags(const struct object_id *oid, int flags)
-{
- return has_sha1_file_with_flags(oid->hash, flags);
-}
-
static void check_tree(const void *buf, size_t size)
{
struct tree_desc desc;