t9001: style modernisation phase #5
[gitweb.git] / notes-merge.c
index 697cec349a2ee3ece9cedd735a4da4828f6621cd..7eb9d7a0103ad8447e4fde50976a5669a75d8cdd 100644 (file)
@@ -549,7 +549,7 @@ int notes_merge(struct notes_merge_options *o,
               o->local_ref, o->remote_ref);
 
        /* Dereference o->local_ref into local_sha1 */
-       if (read_ref_full(o->local_ref, local_sha1, 0, NULL))
+       if (read_ref_full(o->local_ref, 0, local_sha1, NULL))
                die("Failed to resolve local notes ref '%s'", o->local_ref);
        else if (!check_refname_format(o->local_ref, 0) &&
                is_null_sha1(local_sha1))
@@ -672,7 +672,8 @@ int notes_merge_commit(struct notes_merge_options *o,
        DIR *dir;
        struct dirent *e;
        struct strbuf path = STRBUF_INIT;
-       char *msg = strstr(partial_commit->buffer, "\n\n");
+       const char *buffer = get_commit_buffer(partial_commit, NULL);
+       const char *msg = strstr(buffer, "\n\n");
        int baselen;
 
        strbuf_addstr(&path, git_path(NOTES_MERGE_WORKTREE));
@@ -721,6 +722,7 @@ int notes_merge_commit(struct notes_merge_options *o,
 
        create_notes_commit(partial_tree, partial_commit->parents,
                            msg, strlen(msg), result_sha1);
+       unuse_commit_buffer(partial_commit, buffer);
        if (o->verbosity >= 4)
                printf("Finalized notes merge commit: %s\n",
                        sha1_to_hex(result_sha1));