Merge branch 'tb/grep-only-matching'
[gitweb.git] / builtin / am.c
index 6273ea5195bb7f7f2296155753c5e7982d533d66..b6eeb46c4b65aefbc83b25d11d2ea28646990137 100644 (file)
@@ -32,6 +32,7 @@
 #include "apply.h"
 #include "string-list.h"
 #include "packfile.h"
+#include "repository.h"
 
 /**
  * Returns 1 if the file is empty or does not exist, 0 otherwise.
@@ -1400,9 +1401,10 @@ static void write_index_patch(const struct am_state *state)
        FILE *fp;
 
        if (!get_oid_tree("HEAD", &head))
-               tree = lookup_tree(&head);
+               tree = lookup_tree(the_repository, &head);
        else
-               tree = lookup_tree(the_hash_algo->empty_tree);
+               tree = lookup_tree(the_repository,
+                                  the_repository->hash_algo->empty_tree);
 
        fp = xfopen(am_path(state, "patch"), "w");
        init_revisions(&rev_info, NULL);
@@ -1631,7 +1633,8 @@ static void do_commit(const struct am_state *state)
 
        if (!get_oid_commit("HEAD", &parent)) {
                old_oid = &parent;
-               commit_list_insert(lookup_commit(&parent), &parents);
+               commit_list_insert(lookup_commit(the_repository, &parent),
+                                  &parents);
        } else {
                old_oid = NULL;
                say(state, stderr, _("applying to an empty history"));