rename READ_SHA1_FILE_REPLACE flag to LOOKUP_REPLACE_OBJECT
authorChristian Couder <chriscool@tuxfamily.org>
Wed, 11 Dec 2013 07:46:04 +0000 (08:46 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 Dec 2013 19:53:48 +0000 (11:53 -0800)
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>
cache.h
sha1_file.c
diff --git a/cache.h b/cache.h
index ce377e1354a4d0fd719b50edb32124110956467f..873a6b5a89b6cd3d32585996abf1974e7a9b3c62 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -760,11 +760,11 @@ int daemon_avoid_alias(const char *path);
 int offset_1st_component(const char *path);
 
 /* object replacement */
-#define READ_SHA1_FILE_REPLACE 1
+#define LOOKUP_REPLACE_OBJECT 1
 extern void *read_sha1_file_extended(const unsigned char *sha1, enum object_type *type, unsigned long *size, unsigned flag);
 static inline void *read_sha1_file(const unsigned char *sha1, enum object_type *type, unsigned long *size)
 {
-       return read_sha1_file_extended(sha1, type, size, READ_SHA1_FILE_REPLACE);
+       return read_sha1_file_extended(sha1, type, size, LOOKUP_REPLACE_OBJECT);
 }
 extern const unsigned char *do_lookup_replace_object(const unsigned char *sha1);
 static inline const unsigned char *lookup_replace_object(const unsigned char *sha1)
index 7dadd04cb75a9f681cab17f616600cf437fe82ba..2bd3acfc73047626b62c3ed9f6f588825c1f21bf 100644 (file)
@@ -2662,7 +2662,7 @@ void *read_sha1_file_extended(const unsigned char *sha1,
        void *data;
        char *path;
        const struct packed_git *p;
-       const unsigned char *repl = (flag & READ_SHA1_FILE_REPLACE)
+       const unsigned char *repl = (flag & LOOKUP_REPLACE_OBJECT)
                ? lookup_replace_object(sha1) : sha1;
 
        errno = 0;