diff options
Diffstat (limited to 'tests/notes/notes.c')
-rw-r--r-- | tests/notes/notes.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/notes/notes.c b/tests/notes/notes.c index d3b915e15..a91bf5bdf 100644 --- a/tests/notes/notes.c +++ b/tests/notes/notes.c @@ -1,5 +1,7 @@ #include "clar_libgit2.h" +#include "buffer.h" + static git_repository *_repo; static git_signature *_sig; @@ -150,7 +152,7 @@ void test_notes_notes__inserting_a_note_without_passing_a_namespace_uses_the_def { git_oid note_oid, target_oid; git_note *note, *default_namespace_note; - const char *default_ref; + git_buf default_ref = GIT_BUF_INIT; cl_git_pass(git_oid_fromstr(&target_oid, "08b041783f40edfe12bb406c9c9a8a040177c125")); cl_git_pass(git_note_default_ref(&default_ref, _repo)); @@ -158,11 +160,12 @@ void test_notes_notes__inserting_a_note_without_passing_a_namespace_uses_the_def create_note(¬e_oid, NULL, "08b041783f40edfe12bb406c9c9a8a040177c125", "hello world\n"); cl_git_pass(git_note_read(¬e, _repo, NULL, &target_oid)); - cl_git_pass(git_note_read(&default_namespace_note, _repo, default_ref, &target_oid)); + cl_git_pass(git_note_read(&default_namespace_note, _repo, git_buf_cstr(&default_ref), &target_oid)); assert_note_equal(note, "hello world\n", ¬e_oid); assert_note_equal(default_namespace_note, "hello world\n", ¬e_oid); + git_buf_free(&default_ref); git_note_free(note); git_note_free(default_namespace_note); } |