diff options
author | Vicent Martà <tanoku@gmail.com> | 2012-05-03 23:27:15 -0700 |
---|---|---|
committer | Vicent Martà <tanoku@gmail.com> | 2012-05-03 23:27:15 -0700 |
commit | 5f8af1bcac3d982adf0bc37a0868e420161dc761 (patch) | |
tree | da738a93013dcd6c92e9249385b72956b5b1a74b /tests-clar | |
parent | 3fd99be98a91416dae77d65fe593965a0723fa8c (diff) | |
parent | 8e210931ca5d57b6ca7bc16b41598faa9339bc09 (diff) | |
download | libgit2-new-error-handling.tar.gz |
Merge pull request #662 from carlosmn/remotesnew-error-handling
Add git_remote_add()
Diffstat (limited to 'tests-clar')
-rw-r--r-- | tests-clar/network/remotelocal.c | 2 | ||||
-rw-r--r-- | tests-clar/network/remotes.c | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/tests-clar/network/remotelocal.c b/tests-clar/network/remotelocal.c index e154226d9..35fa072ef 100644 --- a/tests-clar/network/remotelocal.c +++ b/tests-clar/network/remotelocal.c @@ -85,7 +85,7 @@ static void connect_to_local_repository(const char *local_repository) { build_local_file_url(&file_path_buf, local_repository); - cl_git_pass(git_remote_new(&remote, repo, git_buf_cstr(&file_path_buf), NULL)); + cl_git_pass(git_remote_new(&remote, repo, NULL, git_buf_cstr(&file_path_buf), NULL)); cl_git_pass(git_remote_connect(remote, GIT_DIR_FETCH)); } diff --git a/tests-clar/network/remotes.c b/tests-clar/network/remotes.c index 36b945f9a..6e5d79b62 100644 --- a/tests-clar/network/remotes.c +++ b/tests-clar/network/remotes.c @@ -57,7 +57,7 @@ void test_network_remotes__save(void) git_remote_free(_remote); /* Set up the remote and save it to config */ - cl_git_pass(git_remote_new(&_remote, _repo, "git://github.com/libgit2/libgit2", "upstream")); + cl_git_pass(git_remote_new(&_remote, _repo, "upstream", "git://github.com/libgit2/libgit2", NULL)); cl_git_pass(git_remote_set_fetchspec(_remote, "refs/heads/*:refs/remotes/upstream/*")); cl_git_pass(git_remote_set_pushspec(_remote, "refs/heads/*:refs/heads/*")); cl_git_pass(git_remote_save(_remote)); @@ -132,3 +132,15 @@ void test_network_remotes__list(void) git_config_free(cfg); } + +void test_network_remotes__add(void) +{ + git_remote_free(_remote); + cl_git_pass(git_remote_add(&_remote, _repo, "addtest", "http://github.com/libgit2/libgit2")); + git_remote_free(_remote); + + cl_git_pass(git_remote_load(&_remote, _repo, "addtest")); + _refspec = git_remote_fetchspec(_remote); + cl_assert(!strcmp(git_refspec_src(_refspec), "refs/heads/*")); + cl_assert(!strcmp(git_refspec_dst(_refspec), "refs/remotes/addtest/*")); +} |