diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-11-02 20:39:29 +0100 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-11-02 20:39:29 +0100 |
commit | ea8dedc953919fa3f7a014ee1e0386f84ed326f1 (patch) | |
tree | f1ddd1ed0a27b587170964a31ab78f93ed64990b | |
parent | 521c0cab7a02f718e4a7e3c2ae7ef81d6f16ffd1 (diff) | |
download | libgit2-ea8dedc953919fa3f7a014ee1e0386f84ed326f1.tar.gz |
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.
-rw-r--r-- | tests/network/remote/local.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/network/remote/local.c b/tests/network/remote/local.c index c6c9e4ca9..7e575b7b9 100644 --- a/tests/network/remote/local.c +++ b/tests/network/remote/local.c @@ -167,17 +167,17 @@ void test_network_remote_local__tagopt(void) { git_reference *ref; - connect_to_local_repository(cl_fixture("testrepo.git")); + cl_git_pass(git_remote_create(&remote, repo, "tagopt", cl_git_path_url(cl_fixture("testrepo.git")))); git_remote_set_autotag(remote, GIT_REMOTE_DOWNLOAD_TAGS_ALL); + cl_git_pass(git_remote_fetch(remote, NULL, NULL, NULL)); - cl_git_pass(git_remote_download(remote, NULL)); - cl_git_pass(git_remote_update_tips(remote, NULL, NULL)); - - - cl_git_fail(git_reference_lookup(&ref, repo, "refs/remotes/master")); - + cl_git_fail(git_reference_lookup(&ref, repo, "refs/remotes/tagopt/master")); cl_git_pass(git_reference_lookup(&ref, repo, "refs/tags/hard_tag")); git_reference_free(ref); + + git_remote_set_autotag(remote, GIT_REMOTE_DOWNLOAD_TAGS_AUTO); + cl_git_pass(git_remote_fetch(remote, NULL, NULL, NULL)); + cl_git_pass(git_reference_lookup(&ref, repo, "refs/remotes/tagopt/master")); } void test_network_remote_local__push_to_bare_remote(void) |