]>
Commit | Line | Data |
---|---|---|
22a2d3d5 UG |
1 | #include "clar_libgit2.h" |
2 | #include "config/config_helpers.h" | |
3 | ||
4 | static git_repository *_repo; | |
5 | ||
6 | #define TEST_URL "http://github.com/libgit2/libgit2.git" | |
7 | ||
8 | void test_remote_list__initialize(void) | |
9 | { | |
10 | _repo = cl_git_sandbox_init("testrepo"); | |
11 | } | |
12 | ||
13 | void test_remote_list__cleanup(void) | |
14 | { | |
15 | cl_git_sandbox_cleanup(); | |
16 | } | |
17 | ||
18 | void test_remote_list__always_checks_disk_config(void) | |
19 | { | |
20 | git_repository *repo; | |
21 | git_strarray remotes; | |
22 | git_remote *remote; | |
23 | ||
24 | cl_git_pass(git_repository_open(&repo, git_repository_path(_repo))); | |
25 | ||
26 | cl_git_pass(git_remote_list(&remotes, _repo)); | |
27 | cl_assert_equal_sz(remotes.count, 1); | |
28 | git_strarray_dispose(&remotes); | |
29 | ||
30 | cl_git_pass(git_remote_create(&remote, _repo, "valid-name", TEST_URL)); | |
31 | ||
32 | cl_git_pass(git_remote_list(&remotes, _repo)); | |
33 | cl_assert_equal_sz(remotes.count, 2); | |
34 | git_strarray_dispose(&remotes); | |
35 | ||
36 | cl_git_pass(git_remote_list(&remotes, repo)); | |
37 | cl_assert_equal_sz(remotes.count, 2); | |
38 | git_strarray_dispose(&remotes); | |
39 | ||
40 | git_repository_free(repo); | |
41 | git_remote_free(remote); | |
42 | } | |
43 |