Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2011-12-15 17:47:22 +0400
committerJunio C Hamano <gitster@pobox.com>2011-12-15 22:46:42 +0400
commit13f8b72d8c8e24215a3dd7771592b30083f1c740 (patch)
tree090da017d258dc9d29af8c270d287f61d44b150a /builtin/commit-tree.c
parent6b3c4c05475d206fafd650d8d27c82a8b051ac30 (diff)
Convert commit_tree() to take strbuf as message
There wan't a way for commit_tree() to notice if the message the caller prepared contained a NUL byte, as it did not take the length of the message as a parameter. Use a pointer to a strbuf instead, so that we can either choose to allow low-level plumbing commands to make commits that contain NUL byte in its message, or forbid NUL everywhere by adding the check in commit_tree(), in later patches. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit-tree.c')
-rw-r--r--builtin/commit-tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c
index d083795e26..0895861457 100644
--- a/builtin/commit-tree.c
+++ b/builtin/commit-tree.c
@@ -56,7 +56,7 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
if (strbuf_read(&buffer, 0, 0) < 0)
die_errno("git commit-tree: failed to read");
- if (commit_tree(buffer.buf, tree_sha1, parents, commit_sha1, NULL)) {
+ if (commit_tree(&buffer, tree_sha1, parents, commit_sha1, NULL)) {
strbuf_release(&buffer);
return 1;
}