{
unsigned char tree_sha1[20];
unsigned char commit_sha1[20];
- struct strbuf msg = STRBUF_INIT;
if (!c || !c->tree.initialized || !c->tree.ref || !*c->tree.ref)
return -1;
if (write_notes_tree(&c->tree, tree_sha1))
return -1;
- strbuf_attach(&msg, c->validity,
- strlen(c->validity), strlen(c->validity) + 1);
- if (commit_tree(msg.buf, msg.len, tree_sha1, NULL, commit_sha1, NULL, NULL) < 0)
+ if (commit_tree(c->validity, strlen(c->validity), tree_sha1, NULL,
+ commit_sha1, NULL, NULL) < 0)
return -1;
if (update_ref("update notes cache", c->tree.ref, commit_sha1, NULL,
0, QUIET_ON_ERR) < 0)
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));
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));