From 80a6c2073b4d90be3e1be21f86afe7a47d1ac7bc Mon Sep 17 00:00:00 2001 From: Ben Peart Date: Tue, 10 Jul 2018 21:08:22 +0000 Subject: convert log_ref_write_fd() to use strbuf Since we don't care about how many bytes were written, simplify the return value logic. log_ref_write_fd() was written long before strbuf was fleshed out. Remove the old manual buffer management code and replace it with strbuf(). Also update copy_reflog_msg() which is called only by log_ref_write_fd() to use strbuf as it keeps things consistent. Signed-off-by: Ben Peart Signed-off-by: Junio C Hamano --- refs/refs-internal.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'refs/refs-internal.h') diff --git a/refs/refs-internal.h b/refs/refs-internal.h index dd834314bd..17a526078f 100644 --- a/refs/refs-internal.h +++ b/refs/refs-internal.h @@ -91,11 +91,10 @@ enum peel_status { enum peel_status peel_object(const struct object_id *name, struct object_id *oid); /* - * Copy the reflog message msg to buf, which has been allocated sufficiently - * large, while cleaning up the whitespaces. Especially, convert LF to space, - * because reflog file is one line per entry. + * Copy the reflog message msg to sb while cleaning up the whitespaces. + * Especially, convert LF to space, because reflog file is one line per entry. */ -int copy_reflog_msg(char *buf, const char *msg); +void copy_reflog_msg(struct strbuf *sb, const char *msg); /** * Information needed for a single ref update. Set new_oid to the new -- cgit v1.2.3