Skip to content

Commit af16878

Browse files
Merge pull request #481 from libgit2/arthur/update-to-latest-libgit2
Update to latest libgit2
2 parents 6cdd589 + 4106f00 commit af16878

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ext/rugged/rugged_note.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,15 +349,20 @@ static VALUE rb_git_note_each(int argc, VALUE *argv, VALUE self)
349349
static VALUE rb_git_note_default_ref_GET(VALUE self)
350350
{
351351
git_repository *repo = NULL;
352-
const char * ref_name;
352+
git_buf ref_name = { 0 };
353+
VALUE rb_result;
353354

354355
Data_Get_Struct(self, git_repository, repo);
355356

356357
rugged_exception_check(
357358
git_note_default_ref(&ref_name, repo)
358359
);
359360

360-
return rb_str_new_utf8(ref_name);
361+
rb_result = rb_enc_str_new(ref_name.ptr, ref_name.size, rb_utf8_encoding());
362+
363+
git_buf_free(&ref_name);
364+
365+
return rb_result;
361366
}
362367

363368
void Init_rugged_notes(void)

vendor/libgit2

Submodule libgit2 updated 129 files

0 commit comments

Comments
 (0)