]> git.ipfire.org Git - thirdparty/git.git/commitdiff
replace_object: don't check read_replace_refs twice
authorChristian Couder <chriscool@tuxfamily.org>
Wed, 11 Dec 2013 07:46:05 +0000 (08:46 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 Dec 2013 19:53:48 +0000 (11:53 -0800)
Since e1111cef (inline lookup_replace_object() calls,
May 15 2011) the read_replace_refs global variable is
checked twice, once in lookup_replace_object() and
once again in do_lookup_replace_object().

As do_lookup_replace_object() is called only from
lookup_replace_object(), we can remove the check in
do_lookup_replace_object().

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
replace_object.c

index d0b1548726e9d2362d27c6947eb61a0647d0eac2..cdcaf8cbe2f4e6c7a5b334fc2c43da6855df4654 100644 (file)
@@ -97,9 +97,6 @@ const unsigned char *do_lookup_replace_object(const unsigned char *sha1)
        int pos, depth = MAXREPLACEDEPTH;
        const unsigned char *cur = sha1;
 
-       if (!read_replace_refs)
-               return sha1;
-
        prepare_replace_object();
 
        /* Try to recursively replace the object */