diff options
Diffstat (limited to 'tests-clar/network')
-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/*")); +} |