diff options
Diffstat (limited to 'tests/refs/read.c')
-rw-r--r-- | tests/refs/read.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/refs/read.c b/tests/refs/read.c index 35cf17e9e..52c307eb0 100644 --- a/tests/refs/read.c +++ b/tests/refs/read.c @@ -271,6 +271,21 @@ void test_refs_read__can_determine_if_a_reference_is_a_tag(void) assert_is_tag("refs/remotes/test/master", false); } +static void assert_is_note(const char *name, bool expected_noteness) +{ + git_reference *reference; + cl_git_pass(git_reference_lookup(&reference, g_repo, name)); + cl_assert_equal_i(expected_noteness, git_reference_is_note(reference)); + git_reference_free(reference); +} + +void test_refs_read__can_determine_if_a_reference_is_a_note(void) +{ + assert_is_note("refs/notes/fanout", true); + assert_is_note("refs/heads/packed", false); + assert_is_note("refs/remotes/test/master", false); +} + void test_refs_read__invalid_name_returns_EINVALIDSPEC(void) { git_reference *reference; |