daemon: move daemonize() to libgit.a
[gitweb.git] / replace_object.c
index 7c6c7544ada4585e62341f0c0854a919f10c2277..cdcaf8cbe2f4e6c7a5b334fc2c43da6855df4654 100644 (file)
@@ -85,19 +85,18 @@ static void prepare_replace_object(void)
 
        for_each_replace_ref(register_replace_ref, NULL);
        replace_object_prepared = 1;
+       if (!replace_object_nr)
+               read_replace_refs = 0;
 }
 
 /* We allow "recursive" replacement. Only within reason, though */
 #define MAXREPLACEDEPTH 5
 
-const unsigned char *lookup_replace_object(const unsigned char *sha1)
+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 */