diff options
| author | Etienne Samson <samson.etienne@gmail.com> | 2019-07-31 08:37:10 +0200 |
|---|---|---|
| committer | Etienne Samson <samson.etienne@gmail.com> | 2019-08-21 12:22:03 +0200 |
| commit | 39d18fe676382cf29ea08427b8ad4527ef51a4bb (patch) | |
| tree | 55bf3ad2b561b1f5ee9370142b2cf89b5e5b6b82 /tests/network | |
| parent | 0f40e68e2f468169d711a806f6839781ae4f7a3e (diff) | |
| download | libgit2-39d18fe676382cf29ea08427b8ad4527ef51a4bb.tar.gz | |
smart: use push_glob instead of manual filtering
The code worked under the assumption that anything under `refs/tags` are
tag objects, and all the rest would be peelable to a commit. As it is
completely valid to have tags to blobs under a non `refs/tags` ref, this
would cause failures when trying to peel a tag to a commit.
Fix the broken filtering by switching to `git_revwalk_push_glob`, which
already handles this case.
Diffstat (limited to 'tests/network')
| -rw-r--r-- | tests/network/fetchlocal.c | 4 | ||||
| -rw-r--r-- | tests/network/remote/local.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/network/fetchlocal.c b/tests/network/fetchlocal.c index 6bc28265b..804308070 100644 --- a/tests/network/fetchlocal.c +++ b/tests/network/fetchlocal.c @@ -419,7 +419,7 @@ void test_network_fetchlocal__multi_remotes(void) cl_git_pass(git_remote_fetch(test, NULL, &options, NULL)); cl_git_pass(git_reference_list(&refnames, repo)); - cl_assert_equal_i(32, (int)refnames.count); + cl_assert_equal_i(33, (int)refnames.count); git_strarray_free(&refnames); cl_git_pass(git_remote_set_url(repo, "test_with_pushurl", cl_git_fixture_url("testrepo.git"))); @@ -427,7 +427,7 @@ void test_network_fetchlocal__multi_remotes(void) cl_git_pass(git_remote_fetch(test2, NULL, &options, NULL)); cl_git_pass(git_reference_list(&refnames, repo)); - cl_assert_equal_i(44, (int)refnames.count); + cl_assert_equal_i(45, (int)refnames.count); git_strarray_free(&refnames); git_remote_free(test); diff --git a/tests/network/remote/local.c b/tests/network/remote/local.c index 99b91c5d0..16cce6777 100644 --- a/tests/network/remote/local.c +++ b/tests/network/remote/local.c @@ -62,7 +62,7 @@ void test_network_remote_local__retrieve_advertised_references(void) cl_git_pass(git_remote_ls(&refs, &refs_len, remote)); - cl_assert_equal_i(refs_len, 28); + cl_assert_equal_i(refs_len, 29); } void test_network_remote_local__retrieve_advertised_before_connect(void) @@ -86,7 +86,7 @@ void test_network_remote_local__retrieve_advertised_references_after_disconnect( cl_git_pass(git_remote_ls(&refs, &refs_len, remote)); - cl_assert_equal_i(refs_len, 28); + cl_assert_equal_i(refs_len, 29); } void test_network_remote_local__retrieve_advertised_references_from_spaced_repository(void) @@ -101,7 +101,7 @@ void test_network_remote_local__retrieve_advertised_references_from_spaced_repos cl_git_pass(git_remote_ls(&refs, &refs_len, remote)); - cl_assert_equal_i(refs_len, 28); + cl_assert_equal_i(refs_len, 29); git_remote_free(remote); /* Disconnect from the "spaced repo" before the cleanup */ remote = NULL; |
