Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ea8dedc

Browse files
committed
remote: fix tagopt test
An anonymous remote wouldn't create remote-tracking branches, so testing we don't create them for TAGS_ALL is nonsensical. Furthermore, the name of the supposed remote-tracking branch was also not one which would have been created had it had a name. Give the remote a name and test that we only create the tags when we pass TAGS_ALL and that we do create the remote-branch branch when given TAGS_AUTO.
1 parent 521c0ca commit ea8dedc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/network/remote/local.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,17 @@ void test_network_remote_local__tagopt(void)
167167
{
168168
git_reference *ref;
169169

170-
connect_to_local_repository(cl_fixture("testrepo.git"));
170+
cl_git_pass(git_remote_create(&remote, repo, "tagopt", cl_git_path_url(cl_fixture("testrepo.git"))));
171171
git_remote_set_autotag(remote, GIT_REMOTE_DOWNLOAD_TAGS_ALL);
172+
cl_git_pass(git_remote_fetch(remote, NULL, NULL, NULL));
172173

173-
cl_git_pass(git_remote_download(remote, NULL));
174-
cl_git_pass(git_remote_update_tips(remote, NULL, NULL));
175-
176-
177-
cl_git_fail(git_reference_lookup(&ref, repo, "refs/remotes/master"));
178-
174+
cl_git_fail(git_reference_lookup(&ref, repo, "refs/remotes/tagopt/master"));
179175
cl_git_pass(git_reference_lookup(&ref, repo, "refs/tags/hard_tag"));
180176
git_reference_free(ref);
177+
178+
git_remote_set_autotag(remote, GIT_REMOTE_DOWNLOAD_TAGS_AUTO);
179+
cl_git_pass(git_remote_fetch(remote, NULL, NULL, NULL));
180+
cl_git_pass(git_reference_lookup(&ref, repo, "refs/remotes/tagopt/master"));
181181
}
182182

183183
void test_network_remote_local__push_to_bare_remote(void)

0 commit comments

Comments
 (0)