summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorLibravatar René Scharfe <l.s.r@web.de>2014-07-17 01:38:18 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-07-17 13:33:52 -0700
commitcedc61a99804db99f9a658c3cccd5c2786a28501 (patch)
tree7bc10fd908eba7b65762badba1a4e27a42c696ae /builtin/commit.c
parentfsck: simplify fsck_commit_buffer() by using commit_list_count() (diff)
downloadtgif-cedc61a99804db99f9a658c3cccd5c2786a28501.tar.xz
strbuf: use strbuf_addstr() for adding C strings
Avoid code duplication and let strbuf_addstr() call strlen() for us. Signed-off-by: Rene Scharfe <l.s.r@web.de> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 461c3b1cad..31d906bbf5 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -707,7 +707,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
char *buffer;
buffer = strstr(use_message_buffer, "\n\n");
if (buffer)
- strbuf_add(&sb, buffer + 2, strlen(buffer + 2));
+ strbuf_addstr(&sb, buffer + 2);
hook_arg1 = "commit";
hook_arg2 = use_message;
} else if (fixup_message) {