use get_cached_commit_buffer where appropriate
[gitweb.git] / notes-merge.c
index 9d942104d2156b1f05554d92c43a5a136fbac125..697cec349a2ee3ece9cedd735a4da4828f6621cd 100644 (file)
@@ -673,7 +673,6 @@ int notes_merge_commit(struct notes_merge_options *o,
        struct dirent *e;
        struct strbuf path = STRBUF_INIT;
        char *msg = strstr(partial_commit->buffer, "\n\n");
-       struct strbuf sb_msg = STRBUF_INIT;
        int baselen;
 
        strbuf_addstr(&path, git_path(NOTES_MERGE_WORKTREE));
@@ -720,10 +719,8 @@ int notes_merge_commit(struct notes_merge_options *o,
                strbuf_setlen(&path, baselen);
        }
 
-       strbuf_attach(&sb_msg, msg, strlen(msg), strlen(msg) + 1);
        create_notes_commit(partial_tree, partial_commit->parents,
-                           sb_msg.buf, sb_msg.len,
-                           result_sha1);
+                           msg, strlen(msg), result_sha1);
        if (o->verbosity >= 4)
                printf("Finalized notes merge commit: %s\n",
                        sha1_to_hex(result_sha1));