path: root/notes-utils.h
diff options
authorJeff King <>2014-06-10 21:36:52 (GMT)
committerJunio C Hamano <>2014-06-12 17:29:41 (GMT)
commit3ffefb54c0515308ceafb6ba071567d9fd379498 (patch)
treebc4051d445ad039b8e1df96c08c7641d711de22c /notes-utils.h
parentbce14aa132e0064d9a9b1c7ad98e71e22c6e0272 (diff)
commit_tree: take a pointer/len pair rather than a const strbuf
While strbufs are pretty common throughout our code, it is more flexible for functions to take a pointer/len pair than a strbuf. It's easy to turn a strbuf into such a pair (by dereferencing its members), but less easy to go the other way (you can strbuf_attach, but that has implications about memory ownership). This patch teaches commit_tree (and its associated callers and sub-functions) to take such a pair for the commit message rather than a strbuf. This makes passing the buffer around slightly more verbose, but means we can get rid of some dangerous strbuf_attach calls in the next patch. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'notes-utils.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/notes-utils.h b/notes-utils.h
index 564e30c..890ddb3 100644
--- a/notes-utils.h
+++ b/notes-utils.h
@@ -15,7 +15,7 @@
* The resulting commit SHA1 is stored in result_sha1.
void create_notes_commit(struct notes_tree *t, struct commit_list *parents,
- const struct strbuf *msg, unsigned char *result_sha1);
+ const char *msg, size_t msg_len, unsigned char *result_sha1);
void commit_notes(struct notes_tree *t, const char *msg);