From 9e88a823f61a3c1b298b0f33d1a260fdc5ee2fa7 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 21 May 2015 13:02:22 +0200 Subject: [PATCH] remote: test insteadOf for anonymous remotes --- tests/remote/insteadof.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/remote/insteadof.c b/tests/remote/insteadof.c index c9b39f098..05d4757cf 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); +}