sha1-name.c: remove implicit dependency on the_index
[gitweb.git] / builtin / merge-tree.c
index bf01e05808313da20ed73c37d0d150c4ddb45587..70f6fc916765c5a5ca67c2dfe72e0480128182e3 100644 (file)
@@ -1,6 +1,8 @@
 #include "builtin.h"
 #include "tree-walk.h"
 #include "xdiff-interface.h"
+#include "object-store.h"
+#include "repository.h"
 #include "blob.h"
 #include "exec-cmd.h"
 #include "merge-blobs.h"
@@ -74,7 +76,7 @@ static void *result(struct merge_list *entry, unsigned long *size)
        their = NULL;
        if (entry)
                their = entry->blob;
-       return merge_blobs(path, base, our, their, size);
+       return merge_blobs(&the_index, path, base, our, their, size);
 }
 
 static void *origin(struct merge_list *entry, unsigned long *size)
@@ -108,7 +110,8 @@ static void show_diff(struct merge_list *entry)
        xpp.flags = 0;
        memset(&xecfg, 0, sizeof(xecfg));
        xecfg.ctxlen = 3;
-       ecb.outf = show_outf;
+       ecb.out_hunk = NULL;
+       ecb.out_line = show_outf;
        ecb.priv = NULL;
 
        src.ptr = origin(entry, &size);
@@ -153,7 +156,7 @@ static int same_entry(struct name_entry *a, struct name_entry *b)
 {
        return  a->oid &&
                b->oid &&
-               !oidcmp(a->oid, b->oid) &&
+               oideq(a->oid, b->oid) &&
                a->mode == b->mode;
 }
 
@@ -169,7 +172,7 @@ static struct merge_list *create_entry(unsigned stage, unsigned mode, const stru
        res->stage = stage;
        res->path = path;
        res->mode = mode;
-       res->blob = lookup_blob(oid);
+       res->blob = lookup_blob(the_repository, oid);
        return res;
 }