summaryrefslogtreecommitdiff
path: root/sha1-file.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-01-07 08:39:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-01-08 17:41:06 (GMT)
commit5d3679ee023642825a5d3c0ca1eec251588a1848 (patch)
treeb62b740259f8dfd219d25833be65ff675eddc2cc /sha1-file.c
parent98374a07c98d1acc200c423b87495365a59cce0b (diff)
downloadgit-5d3679ee023642825a5d3c0ca1eec251588a1848.zip
git-5d3679ee023642825a5d3c0ca1eec251588a1848.tar.gz
git-5d3679ee023642825a5d3c0ca1eec251588a1848.tar.bz2
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 95186c0..0d926e3 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;