From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: git@vger.kernel.org
Cc: "Jeff King" <peff@peff.net>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
"Michael Haggerty" <mhagger@alum.mit.edu>,
"Junio C Hamano" <gitster@pobox.com>
Subject: [PATCH v4 01/12] sha1_file: introduce has_object_file helper.
Date: Tue, 10 Nov 2015 02:22:19 +0000 [thread overview]
Message-ID: <1447122150-672570-2-git-send-email-sandals@crustytoothpaste.net> (raw)
In-Reply-To: <1447122150-672570-1-git-send-email-sandals@crustytoothpaste.net>
Add has_object_file, which is a wrapper around has_sha1_file, but for
struct object_id.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
---
cache.h | 3 +++
sha1_file.c | 5 +++++
2 files changed, 8 insertions(+)
diff --git a/cache.h b/cache.h
index 3ba0b8f3..27bc121b 100644
--- a/cache.h
+++ b/cache.h
@@ -1030,6 +1030,9 @@ static inline int has_sha1_file(const unsigned char *sha1)
return has_sha1_file_with_flags(sha1, 0);
}
+/* Same as the above, except for struct object_id. */
+extern int has_object_file(const struct object_id *oid);
+
/*
* Return true iff an alternate object database has a loose object
* with the specified name. This function does not respect replace
diff --git a/sha1_file.c b/sha1_file.c
index c5b31de9..59515b77 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -3227,6 +3227,11 @@ int has_sha1_file_with_flags(const unsigned char *sha1, int flags)
return find_pack_entry(sha1, &e);
}
+int has_object_file(const struct object_id *oid)
+{
+ return has_sha1_file(oid->hash);
+}
+
static void check_tree(const void *buf, size_t size)
{
struct tree_desc desc;
--
2.6.2.409.gb049f0a
next prev parent reply other threads:[~2015-11-10 2:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-10 2:22 [PATCH v4 00/12] object_id part 2 brian m. carlson
2015-11-10 2:22 ` brian m. carlson [this message]
2015-11-10 2:22 ` [PATCH v4 02/12] Convert struct ref to use object_id brian m. carlson
2015-11-10 2:22 ` [PATCH v4 03/12] add_sought_entry_mem: convert to struct object_id brian m. carlson
2015-11-10 2:22 ` [PATCH v4 04/12] parse_fetch: convert to use " brian m. carlson
2015-11-10 2:22 ` [PATCH v4 05/12] get_remote_heads: convert to " brian m. carlson
2015-11-10 2:22 ` [PATCH v4 06/12] push_refs_with_export: " brian m. carlson
2015-11-10 2:22 ` [PATCH v4 07/12] ref_newer: convert to use " brian m. carlson
2015-11-10 2:22 ` [PATCH v4 08/12] object: introduce get_object_hash macro brian m. carlson
2015-11-10 2:22 ` [PATCH v4 09/12] Add several uses of get_object_hash brian m. carlson
2015-11-20 11:38 ` Jeff King
2015-11-20 13:00 ` brian m. carlson
2015-11-10 2:22 ` [PATCH v4 10/12] Convert struct object to object_id brian m. carlson
2015-11-10 2:22 ` [PATCH v4 11/12] Remove get_object_hash brian m. carlson
2015-11-10 2:22 ` [PATCH v4 12/12] remote: convert functions to struct object_id brian m. carlson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1447122150-672570-2-git-send-email-sandals@crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mhagger@alum.mit.edu \
--cc=pclouds@gmail.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).