diff options
Diffstat (limited to 'tests-clar/notes/notes.c')
-rw-r--r-- | tests-clar/notes/notes.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests-clar/notes/notes.c b/tests-clar/notes/notes.c index d79c21165..068e44c5f 100644 --- a/tests-clar/notes/notes.c +++ b/tests-clar/notes/notes.c @@ -179,3 +179,36 @@ void test_notes_notes__can_correctly_insert_a_note_in_an_existing_fanout(void) git_oid_cpy(&target_oid, ¬e_oid); } } + +/* + * $ git notes --ref fanout list 8496071c1b46c854b31185ea97743be6a8774479 + * 08b041783f40edfe12bb406c9c9a8a040177c125 + */ +void test_notes_notes__can_read_a_note_in_an_existing_fanout(void) +{ + git_oid note_oid, target_oid; + git_note *note; + + cl_git_pass(git_oid_fromstr(&target_oid, "8496071c1b46c854b31185ea97743be6a8774479")); + cl_git_pass(git_note_read(¬e, _repo, "refs/notes/fanout", &target_oid)); + + cl_git_pass(git_oid_fromstr(¬e_oid, "08b041783f40edfe12bb406c9c9a8a040177c125")); + cl_assert(!git_oid_cmp(git_note_oid(note), ¬e_oid)); + + git_note_free(note); +} + +/* + * $ git notes --ref fanout list 8496071c1b46c854b31185ea97743be6a8774479 + * 08b041783f40edfe12bb406c9c9a8a040177c125 + */ +void test_notes_notes__can_remove_a_note_in_an_existing_fanout(void) +{ + git_oid target_oid; + git_note *note; + + cl_git_pass(git_oid_fromstr(&target_oid, "8496071c1b46c854b31185ea97743be6a8774479")); + cl_git_pass(git_note_remove(_repo, "refs/notes/fanout", _sig, _sig, &target_oid)); + + cl_git_fail(git_note_read(¬e, _repo, "refs/notes/fanout", &target_oid)); +} |