diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2013-05-04 18:32:58 +0400 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-05-11 13:20:38 +0400 |
commit | 2b562c3a1edf0f521bdb7adf23e524d5a8389b15 (patch) | |
tree | a5ac3a5b361eb21fbcf77fb4c05ce574ab194c65 /tests-clar/refs | |
parent | 95727245fd4f08aa77d1077901976ab3bd7472e1 (diff) |
refs: remove the OID/SYMBOLIC filtering
Nobody should ever be using anything other than ALL at this level, so
remove the option altogether.
As part of this, git_reference_foreach_glob is now implemented in the
frontend using an iterator. Backends will later regain the ability of
doing the glob filtering in the backend.
Diffstat (limited to 'tests-clar/refs')
-rw-r--r-- | tests-clar/refs/foreachglob.c | 14 | ||||
-rw-r--r-- | tests-clar/refs/list.c | 4 | ||||
-rw-r--r-- | tests-clar/refs/listall.c | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/tests-clar/refs/foreachglob.c b/tests-clar/refs/foreachglob.c index 4da1a15dd..2c458082f 100644 --- a/tests-clar/refs/foreachglob.c +++ b/tests-clar/refs/foreachglob.c @@ -37,11 +37,11 @@ static int count_cb(const char *reference_name, void *payload) return 0; } -static void assert_retrieval(const char *glob, unsigned int flags, int expected_count) +static void assert_retrieval(const char *glob, int expected_count) { int count = 0; - cl_git_pass(git_reference_foreach_glob(repo, glob, flags, count_cb, &count)); + cl_git_pass(git_reference_foreach_glob(repo, glob, count_cb, &count)); cl_assert_equal_i(expected_count, count); } @@ -49,17 +49,17 @@ static void assert_retrieval(const char *glob, unsigned int flags, int expected_ void test_refs_foreachglob__retrieve_all_refs(void) { /* 12 heads (including one packed head) + 1 note + 2 remotes + 7 tags */ - assert_retrieval("*", GIT_REF_LISTALL, 22); + assert_retrieval("*", 22); } void test_refs_foreachglob__retrieve_remote_branches(void) { - assert_retrieval("refs/remotes/*", GIT_REF_LISTALL, 2); + assert_retrieval("refs/remotes/*", 2); } void test_refs_foreachglob__retrieve_local_branches(void) { - assert_retrieval("refs/heads/*", GIT_REF_LISTALL, 12); + assert_retrieval("refs/heads/*", 12); } void test_refs_foreachglob__retrieve_partially_named_references(void) @@ -69,7 +69,7 @@ void test_refs_foreachglob__retrieve_partially_named_references(void) * refs/remotes/test/master, refs/tags/test */ - assert_retrieval("*test*", GIT_REF_LISTALL, 4); + assert_retrieval("*test*", 4); } @@ -89,7 +89,7 @@ void test_refs_foreachglob__can_cancel(void) int count = 0; cl_assert_equal_i(GIT_EUSER, git_reference_foreach_glob( - repo, "*", GIT_REF_LISTALL, interrupt_cb, &count) ); + repo, "*", interrupt_cb, &count) ); cl_assert_equal_i(11, count); } diff --git a/tests-clar/refs/list.c b/tests-clar/refs/list.c index 8a386fdfd..c9c2af4a7 100644 --- a/tests-clar/refs/list.c +++ b/tests-clar/refs/list.c @@ -25,7 +25,7 @@ void test_refs_list__all(void) // try to list all the references in our test repo git_strarray ref_list; - cl_git_pass(git_reference_list(&ref_list, g_repo, GIT_REF_LISTALL)); + cl_git_pass(git_reference_list(&ref_list, g_repo)); /*{ unsigned short i; @@ -50,7 +50,7 @@ void test_refs_list__do_not_retrieve_references_which_name_end_with_a_lock_exten "./testrepo/.git/refs/heads/hanwen.lock", "144344043ba4d4a405da03de3844aa829ae8be0e\n"); - cl_git_pass(git_reference_list(&ref_list, g_repo, GIT_REF_LISTALL)); + cl_git_pass(git_reference_list(&ref_list, g_repo)); cl_assert_equal_i((int)ref_list.count, 13); git_strarray_free(&ref_list); diff --git a/tests-clar/refs/listall.c b/tests-clar/refs/listall.c index 8f4c3746b..c696fbb2e 100644 --- a/tests-clar/refs/listall.c +++ b/tests-clar/refs/listall.c @@ -9,7 +9,7 @@ static void ensure_no_refname_starts_with_a_forward_slash(const char *path) size_t i; cl_git_pass(git_repository_open(&repo, path)); - cl_git_pass(git_reference_list(&ref_list, repo, GIT_REF_LISTALL)); + cl_git_pass(git_reference_list(&ref_list, repo)); cl_assert(ref_list.count > 0); @@ -38,7 +38,7 @@ void test_refs_listall__from_repository_opened_through_gitdir_path(void) void test_refs_listall__from_repository_with_no_trailing_newline(void) { cl_git_pass(git_repository_open(&repo, cl_fixture("bad_tag.git"))); - cl_git_pass(git_reference_list(&ref_list, repo, GIT_REF_LISTALL)); + cl_git_pass(git_reference_list(&ref_list, repo)); cl_assert(ref_list.count > 0); |