Skip to content

Commit fa69195

Browse files
committed
tests: git_remote_create_with_fetchspec
1 parent 10fa2dd commit fa69195

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/remote/create.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,26 @@ void test_remote_create__with_fetchspec(void)
102102
git_strarray_free(&array);
103103
git_remote_free(remote);
104104
}
105+
106+
void test_remote_create__with_empty_fetchspec(void)
107+
{
108+
git_remote *remote;
109+
git_strarray array;
110+
111+
cl_git_pass(git_remote_create_with_fetchspec(&remote, _repo, "test-new", "git://github.com/libgit2/libgit2", NULL));
112+
cl_git_pass(git_remote_get_fetch_refspecs(&array, remote));
113+
cl_assert_equal_i(0, array.count);
114+
115+
git_strarray_free(&array);
116+
git_remote_free(remote);
117+
}
118+
119+
void test_remote_create__with_fetchspec_invalid_name(void)
120+
{
121+
cl_git_assert_cannot_create_remote(GIT_EINVALIDSPEC, git_remote_create_with_fetchspec(&r, _repo, NULL, TEST_URL, NULL));
122+
}
123+
124+
void test_remote_create__with_fetchspec_invalid_url(void)
125+
{
126+
cl_git_assert_cannot_create_remote(GIT_EINVALIDSPEC, git_remote_create_with_fetchspec(&r, _repo, NULL, "", NULL));
127+
}

0 commit comments

Comments
 (0)