Welcome to mirror list, hosted at ThFree Co, Russian Federation.

createremotethenload.c « network « tests-clar - github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 45931d37653bcb18e0a451f41b207ad347482e3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "clar_libgit2.h"

static git_remote *_remote;
static git_repository *_repo;
static git_config *_config;
static char url[] = "http://github.com/libgit2/libgit2.git";

void test_network_createremotethenload__initialize(void)
{
	cl_fixture_sandbox("testrepo.git");

	cl_git_pass(git_repository_open(&_repo, "testrepo.git"));

	cl_git_pass(git_repository_config(&_config, _repo));
	cl_git_pass(git_config_set_string(_config, "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*"));
	cl_git_pass(git_config_set_string(_config, "remote.origin.url", url));
	git_config_free(_config);

	cl_git_pass(git_remote_load(&_remote, _repo, "origin"));
}

void test_network_createremotethenload__cleanup(void)
{
	git_remote_free(_remote);
	git_repository_free(_repo);
	cl_fixture_cleanup("testrepo.git");
}

void test_network_createremotethenload__parsing(void)
{
	cl_assert_equal_s(git_remote_name(_remote), "origin");
	cl_assert_equal_s(git_remote_url(_remote), url);
}