summaryrefslogtreecommitdiff
path: root/notes-merge.c
diff options
context:
space:
mode:
Diffstat (limited to 'notes-merge.c')
-rw-r--r--notes-merge.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/notes-merge.c b/notes-merge.c
index b4cc594a79..233e49e319 100644
--- a/notes-merge.c
+++ b/notes-merge.c
@@ -1,18 +1,25 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "advice.h"
#include "commit.h"
+#include "gettext.h"
#include "refs.h"
+#include "object-file.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 +333,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 +573,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 +607,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 +685,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 +733,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));