inline lookup_replace_object() calls
[gitweb.git] / sha1_file.c
index 889fe7183065ae8bc12821aadebb69a17bc7635c..5d80febde24ebf4e8cf72923a3fb684942a82e75 100644 (file)
@@ -2206,10 +2206,9 @@ static void *read_object(const unsigned char *sha1, enum object_type *type,
  * deal with them should arrange to call read_object() and give error
  * messages themselves.
  */
-void *read_sha1_file_repl(const unsigned char *sha1,
-                         enum object_type *type,
-                         unsigned long *size,
-                         const unsigned char **replacement)
+void *read_sha1_file(const unsigned char *sha1,
+                    enum object_type *type,
+                    unsigned long *size)
 {
        const unsigned char *repl = lookup_replace_object(sha1);
        void *data;
@@ -2218,11 +2217,8 @@ void *read_sha1_file_repl(const unsigned char *sha1,
 
        errno = 0;
        data = read_object(repl, type, size);
-       if (data) {
-               if (replacement)
-                       *replacement = repl;
+       if (data)
                return data;
-       }
 
        if (errno && errno != ENOENT)
                die_errno("failed to read object %s", sha1_to_hex(sha1));