]> git.ipfire.org Git - thirdparty/git.git/blobdiff - notes-merge.c
object-name.h: move declarations for object-name.c functions from cache.h
[thirdparty/git.git] / notes-merge.c
index b4cc594a790965aca297fe87392a50b643e6fb41..b496b77d9db128c40c4b30e40360cf9656696409 100644 (file)
@@ -1,18 +1,24 @@
 #include "cache.h"
+#include "advice.h"
 #include "commit.h"
+#include "gettext.h"
 #include "refs.h"
+#include "object-name.h"
 #include "object-store.h"
 #include "repository.h"
 #include "diff.h"
 #include "diffcore.h"
+#include "hex.h"
 #include "xdiff-interface.h"
 #include "ll-merge.h"
 #include "dir.h"
 #include "notes.h"
 #include "notes-merge.h"
 #include "strbuf.h"
+#include "trace.h"
 #include "notes-utils.h"
 #include "commit-reach.h"
+#include "wrapper.h"
 
 struct notes_merge_pair {
        struct object_id obj, base, local, remote;
@@ -326,7 +332,7 @@ static void write_note_to_worktree(const struct object_id *obj,
 {
        enum object_type type;
        unsigned long size;
-       void *buf = read_object_file(note, &type, &size);
+       void *buf = repo_read_object_file(the_repository, note, &type, &size);
 
        if (!buf)
                die("cannot read note %s for object %s",
@@ -566,7 +572,7 @@ int notes_merge(struct notes_merge_options *o,
        trace_printf("\tlocal commit: %.7s\n", oid_to_hex(&local_oid));
 
        /* Dereference o->remote_ref into remote_oid */
-       if (get_oid(o->remote_ref, &remote_oid)) {
+       if (repo_get_oid(the_repository, o->remote_ref, &remote_oid)) {
                /*
                 * Failed to get remote_oid. If o->remote_ref looks like an
                 * unborn ref, perform the merge using an empty notes tree.
@@ -600,7 +606,7 @@ int notes_merge(struct notes_merge_options *o,
        assert(local && remote);
 
        /* Find merge bases */
-       bases = get_merge_bases(local, remote);
+       bases = repo_get_merge_bases(the_repository, local, remote);
        if (!bases) {
                base_oid = null_oid();
                base_tree_oid = the_hash_algo->empty_tree;
@@ -678,7 +684,8 @@ int notes_merge_commit(struct notes_merge_options *o,
        DIR *dir;
        struct dirent *e;
        struct strbuf path = STRBUF_INIT;
-       const char *buffer = get_commit_buffer(partial_commit, NULL);
+       const char *buffer = repo_get_commit_buffer(the_repository,
+                                                   partial_commit, NULL);
        const char *msg = strstr(buffer, "\n\n");
        int baselen;
 
@@ -725,7 +732,7 @@ int notes_merge_commit(struct notes_merge_options *o,
 
        create_notes_commit(o->repo, partial_tree, partial_commit->parents, msg,
                            strlen(msg), result_oid);
-       unuse_commit_buffer(partial_commit, buffer);
+       repo_unuse_commit_buffer(the_repository, partial_commit, buffer);
        if (o->verbosity >= 4)
                printf("Finalized notes merge commit: %s\n",
                        oid_to_hex(result_oid));