X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=notes-cache.c;h=eabe4a0d9bf44050dba43cbd821642cdfd3fb40b;hb=d3f2475c01d9e90dbadacbe2c35854f6d11e6409;hp=4c8984ede1e218d3e0aaadb6d8c72bfcafddeee9;hpb=9ef569791f967c1559b498d8f77a2c42a14be2ed;p=git.git diff --git a/notes-cache.c b/notes-cache.c index 4c8984ede..eabe4a0d9 100644 --- a/notes-cache.c +++ b/notes-cache.c @@ -48,6 +48,7 @@ int notes_cache_write(struct notes_cache *c) { 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; @@ -56,7 +57,9 @@ int notes_cache_write(struct notes_cache *c) if (write_notes_tree(&c->tree, tree_sha1)) return -1; - if (commit_tree(c->validity, tree_sha1, NULL, commit_sha1, NULL) < 0) + strbuf_attach(&msg, c->validity, + strlen(c->validity), strlen(c->validity) + 1); + if (commit_tree(&msg, 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)