diff options
Diffstat (limited to 'tests-clar/refs/list.c')
-rw-r--r-- | tests-clar/refs/list.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tests-clar/refs/list.c b/tests-clar/refs/list.c index 2a7b157ca..3948b2b7a 100644 --- a/tests-clar/refs/list.c +++ b/tests-clar/refs/list.c @@ -33,10 +33,10 @@ void test_refs_list__all(void) printf("# %s\n", ref_list.strings[i]); }*/ - /* We have exactly 9 refs in total if we include the packed ones: + /* We have exactly 12 refs in total if we include the packed ones: * there is a reference that exists both in the packfile and as * loose, but we only list it once */ - cl_assert(ref_list.count == 9); + cl_assert_equal_i((int)ref_list.count, 13); git_strarray_free(&ref_list); } @@ -51,3 +51,18 @@ void test_refs_list__symbolic_only(void) git_strarray_free(&ref_list); } + +void test_refs_list__do_not_retrieve_references_which_name_end_with_a_lock_extension(void) +{ + git_strarray ref_list; + + /* Create a fake locked reference */ + cl_git_mkfile( + "./testrepo/.git/refs/heads/hanwen.lock", + "144344043ba4d4a405da03de3844aa829ae8be0e\n"); + + cl_git_pass(git_reference_list(&ref_list, g_repo, GIT_REF_LISTALL)); + cl_assert_equal_i((int)ref_list.count, 13); + + git_strarray_free(&ref_list); +} |