rename READ_SHA1_FILE_REPLACE flag to LOOKUP_REPLACE_OBJECT

The READ_SHA1_FILE_REPLACE flag is more related to using the lookup_replace_object() function rather than the read_sha1_file() function. We also need such a flag to be used with sha1_object_info() instead of read_sha1_file(). The name LOOKUP_REPLACE_OBJECT is therefore better for this flag. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Christian Couder committed Dec 11, 2013 at 08:46 UTC ffe68cf9acf1127078b0dfa0b09661ce52916642
2 files changed +3 -3
cache.h
+2 -2
@@ -760,11 +760,11 @@ int daemon_avoid_alias(const char *path);
760 int offset_1st_component(const char *path);
761
762 /* object replacement */
763 -#define READ_SHA1_FILE_REPLACE 1
763 +#define LOOKUP_REPLACE_OBJECT 1
764 extern void *read_sha1_file_extended(const unsigned char *sha1, enum object_type *type, unsigned long *size, unsigned flag);
765 static inline void *read_sha1_file(const unsigned char *sha1, enum object_type *type, unsigned long *size)
766 {
767 - return read_sha1_file_extended(sha1, type, size, READ_SHA1_FILE_REPLACE);
767 + return read_sha1_file_extended(sha1, type, size, LOOKUP_REPLACE_OBJECT);
768 }
769 extern const unsigned char *do_lookup_replace_object(const unsigned char *sha1);
770 static inline const unsigned char *lookup_replace_object(const unsigned char *sha1)
sha1_file.c
+1 -1
@@ -2662,7 +2662,7 @@ void *read_sha1_file_extended(const unsigned char *sha1,
2662 void *data;
2663 char *path;
2664 const struct packed_git *p;
2665 - const unsigned char *repl = (flag & READ_SHA1_FILE_REPLACE)
2665 + const unsigned char *repl = (flag & LOOKUP_REPLACE_OBJECT)
2666 ? lookup_replace_object(sha1) : sha1;
2667
2668 errno = 0;