summaryrefslogtreecommitdiff
path: root/tests-clar/network/remotes.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests-clar/network/remotes.c')
-rw-r--r--tests-clar/network/remotes.c14
1 files changed, 13 insertions, 1 deletions
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/*"));
+}