From 538a05d55c6051371dd1749af75a7b2e2d623d53 Mon Sep 17 00:00:00 2001 From: Carlos Martín Nieto Date: Wed, 8 Aug 2018 11:51:51 +0200 Subject: Remove uses of deprecated git_buf_free --- commit.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'commit.go') diff --git a/commit.go b/commit.go index 223b093..0ab720d 100644 --- a/commit.go +++ b/commit.go @@ -37,10 +37,10 @@ func (c *Commit) RawMessage() string { func (c *Commit) ExtractSignature() (string, string, error) { var c_signed C.git_buf - defer C.git_buf_free(&c_signed) + defer C.git_buf_dispose(&c_signed) var c_signature C.git_buf - defer C.git_buf_free(&c_signature) + defer C.git_buf_dispose(&c_signature) oid := c.Id() repo := C.git_commit_owner(c.cast_ptr) -- cgit v1.2.3 From fe0f562cc03d300ec351beca53b5eed7fe4b29e4 Mon Sep 17 00:00:00 2001 From: Takuji Shimokawa Date: Fri, 10 May 2019 20:31:01 +0900 Subject: Add Commit.MessageEncoding() method. --- commit.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'commit.go') diff --git a/commit.go b/commit.go index 0ab720d..4262060 100644 --- a/commit.go +++ b/commit.go @@ -28,6 +28,12 @@ func (c *Commit) Message() string { return ret } +func (c *Commit) MessageEncoding() string { + ret := C.GoString(C.git_commit_message_encoding(c.cast_ptr)) + runtime.KeepAlive(c) + return ret +} + func (c *Commit) RawMessage() string { ret := C.GoString(C.git_commit_message_raw(c.cast_ptr)) runtime.KeepAlive(c) -- cgit v1.2.3