tree: add repository argument to lookup_tree
[gitweb.git] / walker.c
index 8eb7db7a52782c9862718979e5270724fd982d1f..a3a256676116731dc5155e2bf2c616b5686dd9d7 100644 (file)
--- a/walker.c
+++ b/walker.c
@@ -1,5 +1,7 @@
 #include "cache.h"
 #include "walker.h"
+#include "repository.h"
+#include "object-store.h"
 #include "commit.h"
 #include "tree.h"
 #include "tree-walk.h"
@@ -47,12 +49,14 @@ static int process_tree(struct walker *walker, struct tree *tree)
                if (S_ISGITLINK(entry.mode))
                        continue;
                if (S_ISDIR(entry.mode)) {
-                       struct tree *tree = lookup_tree(entry.oid);
+                       struct tree *tree = lookup_tree(the_repository,
+                                                       entry.oid);
                        if (tree)
                                obj = &tree->object;
                }
                else {
-                       struct blob *blob = lookup_blob(entry.oid);
+                       struct blob *blob = lookup_blob(the_repository,
+                                                       entry.oid);
                        if (blob)
                                obj = &blob->object;
                }
@@ -88,7 +92,7 @@ static int process_commit(struct walker *walker, struct commit *commit)
 
        walker_say(walker, "walk %s\n", oid_to_hex(&commit->object.oid));
 
-       if (process(walker, &commit->tree->object))
+       if (process(walker, &get_commit_tree(commit)->object))
                return -1;
 
        for (parents = commit->parents; parents; parents = parents->next) {
@@ -177,7 +181,7 @@ static int loop(struct walker *walker)
                        }
                }
                if (!obj->type)
-                       parse_object(&obj->oid);
+                       parse_object(the_repository, &obj->oid);
                if (process_object(walker, obj))
                        return -1;
        }