test-reach: test is_descendant_of
[gitweb.git] / builtin / fmt-merge-msg.c
index 1b526adb3a95bbef0eabf8d154f0f6f9da1ef214..7277d557b2d1972250e5b8b4117bc3be23964b6f 100644 (file)
@@ -11,6 +11,8 @@
 #include "branch.h"
 #include "fmt-merge-msg.h"
 #include "gpg-interface.h"
+#include "repository.h"
+#include "commit-reach.h"
 
 static const char * const fmt_merge_msg_usage[] = {
        N_("git fmt-merge-msg [-m <message>] [--log[=<n>] | --no-log] [--file <file>]"),
@@ -343,7 +345,9 @@ static void shortlog(const char *name,
        const struct object_id *oid = &origin_data->oid;
        int limit = opts->shortlog_len;
 
-       branch = deref_tag(parse_object(oid), oid_to_hex(oid), GIT_SHA1_HEXSZ);
+       branch = deref_tag(the_repository, parse_object(the_repository, oid),
+                          oid_to_hex(oid),
+                          GIT_SHA1_HEXSZ);
        if (!branch || branch->type != OBJ_COMMIT)
                return;
 
@@ -563,14 +567,14 @@ static void find_merge_parents(struct merge_parents *result,
                 * "name" here and we do not want to contaminate its
                 * util field yet.
                 */
-               obj = parse_object(&oid);
+               obj = parse_object(the_repository, &oid);
                parent = (struct commit *)peel_to_type(NULL, 0, obj, OBJ_COMMIT);
                if (!parent)
                        continue;
                commit_list_insert(parent, &parents);
                add_merge_parent(result, &obj->oid, &parent->object.oid);
        }
-       head_commit = lookup_commit(head);
+       head_commit = lookup_commit(the_repository, head);
        if (head_commit)
                commit_list_insert(head_commit, &parents);
        reduce_heads_replace(&parents);