Thread (15 messages) flat view 15 messages, 2 authors, 2016-06-15
STALE3744d

Revision v4 of 4 in this series.

Revisions (4)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 [diff vs current]
  4. v4 current

[PATCH v4 01/12] sha1_file: introduce has_object_file helper.

From: brian m. carlson <hidden>
Date: 2016-06-15 23:07:13
Subsystem: the rest · Maintainer: Linus Torvalds

Add has_object_file, which is a wrapper around has_sha1_file, but for
struct object_id.

Signed-off-by: brian m. carlson <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help