diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2014-11-08 17:05:13 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2014-11-08 17:05:13 -0500 |
commit | 02bc5233041ba0b83fc8db66e02214c99f1e75fe (patch) | |
tree | 42c07e3d5a6baa826d327ea5f1fb1a1e692f7a35 /tests | |
parent | bc8c4a8aeb7323e6e7431797a2be0d0e0035d9e8 (diff) | |
parent | 2c9b9c8bb4ffe083ddea7044cdfd07d6985756d6 (diff) | |
download | libgit2-02bc5233041ba0b83fc8db66e02214c99f1e75fe.tar.gz |
Merge pull request #2698 from libgit2/cmn/fetchhead-refactor
Refactor fetchhead
Diffstat (limited to 'tests')
-rw-r--r-- | tests/network/remote/remotes.c | 10 | ||||
-rw-r--r-- | tests/refs/branches/upstream.c | 9 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/network/remote/remotes.c b/tests/network/remote/remotes.c index a5e1ba2e3..07ad934c7 100644 --- a/tests/network/remote/remotes.c +++ b/tests/network/remote/remotes.c @@ -535,6 +535,16 @@ static int remote_single_branch(git_remote **out, git_repository *repo, const ch return 0; } +void test_network_remote_remotes__fetch_from_anonymous(void) +{ + git_remote *remote; + + cl_git_pass(git_remote_create_anonymous(&remote, _repo, cl_fixture("testrepo.git"), + "refs/heads/*:refs/other/*")); + cl_git_pass(git_remote_fetch(remote, NULL, NULL, NULL)); + git_remote_free(remote); +} + void test_network_remote_remotes__single_branch(void) { git_clone_options opts = GIT_CLONE_OPTIONS_INIT; diff --git a/tests/refs/branches/upstream.c b/tests/refs/branches/upstream.c index ce3569813..abf7933d3 100644 --- a/tests/refs/branches/upstream.c +++ b/tests/refs/branches/upstream.c @@ -61,6 +61,15 @@ void test_refs_branches_upstream__trying_to_retrieve_a_remote_tracking_reference cl_assert_equal_i(GIT_ENOTFOUND, git_branch_upstream(&upstream, branch)); } +void test_refs_branches_upstream__upstream_remote(void) +{ + git_buf buf = GIT_BUF_INIT; + + cl_git_pass(git_branch_upstream_remote(&buf, repo, "refs/heads/master")); + cl_assert_equal_s("test", buf.ptr); + git_buf_free(&buf); +} + static void assert_merge_and_or_remote_key_missing(git_repository *repository, const git_commit *target, const char *entry_name) { git_reference *branch; |