summaryrefslogtreecommitdiff
path: root/tests/online
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-05-20 09:55:26 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-05-21 12:12:32 +0200
commit306475eb0173d7943a27afee6054af8d0f76bedd (patch)
tree01940bc9610fe5af6ecb9fced14d0f3d3c4f9f77 /tests/online
parent8156835df17d89bd7ce1525792aa13146fab551e (diff)
downloadlibgit2-306475eb0173d7943a27afee6054af8d0f76bedd.tar.gz
remote: expose the remote's symref mappings
Add a symref_target field to git_remote_head to expose the symref mappings to the user.
Diffstat (limited to 'tests/online')
-rw-r--r--tests/online/fetch.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/online/fetch.c b/tests/online/fetch.c
index c54ec5673..f03a6faa6 100644
--- a/tests/online/fetch.c
+++ b/tests/online/fetch.c
@@ -184,3 +184,21 @@ void test_online_fetch__ls_disconnected(void)
git_remote_free(remote);
}
+
+void test_online_fetch__remote_symrefs(void)
+{
+ const git_remote_head **refs;
+ size_t refs_len;
+ git_remote *remote;
+
+ cl_git_pass(git_remote_create(&remote, _repo, "test",
+ "http://github.com/libgit2/TestGitRepository.git"));
+ cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH));
+ git_remote_disconnect(remote);
+ cl_git_pass(git_remote_ls(&refs, &refs_len, remote));
+
+ cl_assert_equal_s("HEAD", refs[0]->name);
+ cl_assert_equal_s("refs/heads/master", refs[0]->symref_target);
+
+ git_remote_free(remote);
+}