From fa9dcb7edeccef2e31e6926259bc46d9cefdd706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Wed, 22 Jun 2011 14:17:29 +0200 Subject: [PATCH] Add refspec match test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Carlos Martín Nieto --- tests/t16-remotes.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/t16-remotes.c b/tests/t16-remotes.c index fed7c7cac..43f5c9610 100644 --- a/tests/t16-remotes.c +++ b/tests/t16-remotes.c @@ -61,7 +61,26 @@ BEGIN_TEST(refspec0, "remote with refspec works") git_repository_free(repo); END_TEST +BEGIN_TEST(refspec1, "remote fnmatch works as expected") + git_remote *remote; + git_repository *repo; + git_config *cfg; + const git_refspec *refspec = NULL; + + must_pass(git_repository_open(&repo, REPOSITORY_FOLDER)); + must_pass(git_repository_config(&cfg, repo, NULL, NULL)); + must_pass(git_remote_get(&remote, cfg, "test")); + refspec = git_remote_fetchspec(remote); + must_be_true(refspec != NULL); + must_pass(git_refspec_src_match(refspec, "refs/heads/master")); + must_pass(git_refspec_src_match(refspec, "refs/heads/multi/level/branch")); + git_remote_free(remote); + git_config_free(cfg); + git_repository_free(repo); +END_TEST + BEGIN_SUITE(remotes) ADD_TEST(remotes0) ADD_TEST(refspec0) + ADD_TEST(refspec1) END_SUITE