submodule-config: lazy-load a repository's .gitmodules file
[gitweb.git] / builtin / merge-tree.c
index 5b7ab9b9672e08d7db843d0ccd951ee4c7bdac15..f12da292cf91b1ecb9fc785fd50bd1ef83b361e9 100644 (file)
@@ -161,14 +161,14 @@ static int both_empty(struct name_entry *a, struct name_entry *b)
        return !(a->oid || b->oid);
 }
 
-static struct merge_list *create_entry(unsigned stage, unsigned mode, const unsigned char *sha1, const char *path)
+static struct merge_list *create_entry(unsigned stage, unsigned mode, const struct object_id *oid, const char *path)
 {
        struct merge_list *res = xcalloc(1, sizeof(*res));
 
        res->stage = stage;
        res->path = path;
        res->mode = mode;
-       res->blob = lookup_blob(sha1);
+       res->blob = lookup_blob(oid);
        return res;
 }
 
@@ -188,8 +188,8 @@ static void resolve(const struct traverse_info *info, struct name_entry *ours, s
                return;
 
        path = traverse_path(info, result);
-       orig = create_entry(2, ours->mode, ours->oid->hash, path);
-       final = create_entry(0, result->mode, result->oid->hash, path);
+       orig = create_entry(2, ours->mode, ours->oid, path);
+       final = create_entry(0, result->mode, result->oid, path);
 
        final->link = orig;
 
@@ -239,7 +239,7 @@ static struct merge_list *link_entry(unsigned stage, const struct traverse_info
                path = entry->path;
        else
                path = traverse_path(info, n);
-       link = create_entry(stage, n->mode, n->oid->hash, path);
+       link = create_entry(stage, n->mode, n->oid, path);
        link->link = entry;
        return link;
 }
@@ -347,12 +347,12 @@ static void merge_trees(struct tree_desc t[3], const char *base)
 
 static void *get_tree_descriptor(struct tree_desc *desc, const char *rev)
 {
-       unsigned char sha1[20];
+       struct object_id oid;
        void *buf;
 
-       if (get_sha1(rev, sha1))
+       if (get_oid(rev, &oid))
                die("unknown rev %s", rev);
-       buf = fill_tree_descriptor(desc, sha1);
+       buf = fill_tree_descriptor(desc, oid.hash);
        if (!buf)
                die("%s is not a tree", rev);
        return buf;