summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2017-06-22 00:40:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-06-26 17:28:58 (GMT)
commite83e71c5e15f2c6aaf9bdb8ee9593a46c3bb9a5b (patch)
tree933f4dd4f8205411367bc2f24208a1a632fd2267 /cache.h
parentcd585e2a33841d725b821adbb9b48654fc7d0b61 (diff)
downloadgit-e83e71c5e15f2c6aaf9bdb8ee9593a46c3bb9a5b.zip
git-e83e71c5e15f2c6aaf9bdb8ee9593a46c3bb9a5b.tar.gz
git-e83e71c5e15f2c6aaf9bdb8ee9593a46c3bb9a5b.tar.bz2
sha1_file: refactor has_sha1_file_with_flags
has_sha1_file_with_flags() implements many mechanisms in common with sha1_object_info_extended(). Make has_sha1_file_with_flags() a convenience function for sha1_object_info_extended() instead. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/cache.h b/cache.h
index 7cf2ca4..3ae9769 100644
--- a/cache.h
+++ b/cache.h
@@ -1268,15 +1268,10 @@ int read_loose_object(const char *path,
void **contents);
/*
- * Return true iff we have an object named sha1, whether local or in
- * an alternate object database, and whether packed or loose. This
- * function does not respect replace references.
- *
- * If the QUICK flag is set, do not re-check the pack directory
- * when we cannot find the object (this means we may give a false
- * negative answer if another process is simultaneously repacking).
+ * Convenience for sha1_object_info_extended() with a NULL struct
+ * object_info. OBJECT_INFO_SKIP_CACHED is automatically set; pass
+ * nonzero flags to also set other flags.
*/
-#define HAS_SHA1_QUICK 0x1
extern int has_sha1_file_with_flags(const unsigned char *sha1, int flags);
static inline int has_sha1_file(const unsigned char *sha1)
{