summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArthur Schreiber <schreiber.arthur@googlemail.com>2014-01-14 21:03:01 +0100
committerArthur Schreiber <schreiber.arthur@googlemail.com>2014-01-14 21:03:01 +0100
commit40ef47dd46fdd361b49ccc97605a93e0993e96db (patch)
tree77e51167172c5324a7dde1f5faf8e55be670be68 /tests
parent557bd1f4108272c6db004aa8b7137d9254c14945 (diff)
downloadlibgit2-40ef47dd46fdd361b49ccc97605a93e0993e96db.tar.gz
Add `git_remote_dup`.
Diffstat (limited to 'tests')
-rw-r--r--tests/network/remote/remotes.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/network/remote/remotes.c b/tests/network/remote/remotes.c
index 954ded82c..235a1022d 100644
--- a/tests/network/remote/remotes.c
+++ b/tests/network/remote/remotes.c
@@ -129,6 +129,27 @@ void test_network_remote_remotes__add_fetchspec(void)
cl_assert_equal_b(_refspec->push, false);
}
+void test_network_remote_remotes__dup(void)
+{
+ git_strarray array;
+ git_remote *dup;
+
+ cl_git_pass(git_remote_dup(&dup, _remote));
+
+ cl_assert_equal_s(git_remote_name(dup), git_remote_name(_remote));
+ cl_assert_equal_s(git_remote_url(dup), git_remote_url(_remote));
+ cl_assert_equal_s(git_remote_pushurl(dup), git_remote_pushurl(_remote));
+
+ cl_git_pass(git_remote_get_fetch_refspecs(&array, _remote));
+ cl_assert_equal_i(1, (int)array.count);
+ cl_assert_equal_s("+refs/heads/*:refs/remotes/test/*", array.strings[0]);
+ git_strarray_free(&array);
+
+ cl_git_pass(git_remote_get_push_refspecs(&array, _remote));
+ cl_assert_equal_i(0, (int)array.count);
+ git_strarray_free(&array);
+}
+
void test_network_remote_remotes__add_pushspec(void)
{
size_t size;