inline lookup_replace_object() calls
[gitweb.git] / sha1_file.c
index df0edbad1e810727e384a5753001dc8c85d4ecf9..5d80febde24ebf4e8cf72923a3fb684942a82e75 100644 (file)
@@ -1534,7 +1534,7 @@ static int unpack_object_header(struct packed_git *p,
        enum object_type type;
 
        /* use_pack() assures us we have [base, base + 20) available
-        * as a range that we can look at at.  (Its actually the hash
+        * as a range that we can look at.  (Its actually the hash
         * size that is assured.)  With our object header encoding
         * the maximum deflated object size is 2^137, which is just
         * insane, so we know won't exceed what we have been given.
@@ -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));