commit-graph: add repo arg to graph readers
[gitweb.git] / cache-tree.c
index 1c338c41f3a760e70fd41ed99090ac0e2f7f7619..181d5919f0fd4d8e838684cd14adafc8fa31ab71 100644 (file)
@@ -386,7 +386,7 @@ static int update_one(struct cache_tree *it,
                /*
                 * "sub" can be an empty tree if all subentries are i-t-a.
                 */
-               if (contains_ita && !oidcmp(oid, &empty_tree_oid))
+               if (contains_ita && is_empty_tree_oid(oid))
                        continue;
 
                strbuf_grow(&buffer, entlen + 100);
@@ -524,7 +524,7 @@ static struct cache_tree *read_one(const char **buffer, unsigned long *size_p)
        if (0 <= it->entry_count) {
                if (size < rawsz)
                        goto free_return;
-               memcpy(it->oid.hash, (const unsigned char*)buf, rawsz);
+               oidread(&it->oid, (const unsigned char *)buf);
                buf += rawsz;
                size -= rawsz;
        }
@@ -671,7 +671,8 @@ static void prime_cache_tree_rec(struct cache_tree *it, struct tree *tree)
                        cnt++;
                else {
                        struct cache_tree_sub *sub;
-                       struct tree *subtree = lookup_tree(entry.oid);
+                       struct tree *subtree = lookup_tree(the_repository,
+                                                          entry.oid);
                        if (!subtree->object.parsed)
                                parse_tree(subtree);
                        sub = cache_tree_sub(it, entry.path);