From e83e71c5e15f2c6aaf9bdb8ee9593a46c3bb9a5b Mon Sep 17 00:00:00 2001 From: Jonathan Tan Date: Wed, 21 Jun 2017 17:40:24 -0700 Subject: 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 Signed-off-by: Junio C Hamano --- cache.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'cache.h') diff --git a/cache.h b/cache.h index 7cf2ca466a..3ae9769aaf 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) { -- cgit v1.2.1