diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2017-06-21 17:40:24 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-26 10:28:58 -0700 |
commit | e83e71c5e15f2c6aaf9bdb8ee9593a46c3bb9a5b (patch) | |
tree | 933f4dd4f8205411367bc2f24208a1a632fd2267 /cache.h | |
parent | sha1_file: do not access pack if unneeded (diff) | |
download | tgif-e83e71c5e15f2c6aaf9bdb8ee9593a46c3bb9a5b.tar.xz |
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.h | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -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) { |