Commit 9e88a823f61a3c1b298b0f33d1a260fdc5ee2fa7

Patrick Steinhardt 2015-05-21T13:02:22

remote: test insteadOf for anonymous remotes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/tests/remote/insteadof.c b/tests/remote/insteadof.c
index c9b39f0..05d4757 100644
--- a/tests/remote/insteadof.c
+++ b/tests/remote/insteadof.c
@@ -58,3 +58,15 @@ void test_remote_insteadof__pushurl_insteadof_applicable(void)
 	    git_remote_pushurl(g_remote),
 	    "git@github.com:libgit2/libgit2");
 }
+
+void test_remote_insteadof__anonymous_remote(void)
+{
+	cl_git_pass(git_repository_open(&g_repo, cl_fixture(REPO_PATH)));
+	cl_git_pass(git_remote_create_anonymous(&g_remote, g_repo,
+	    "http://example.com/libgit2/libgit2"));
+
+	cl_assert_equal_s(
+	    git_remote_url(g_remote),
+	    "http://github.com/libgit2/libgit2");
+	cl_assert_equal_p(git_remote_pushurl(g_remote), NULL);
+}