]>
Commit | Line | Data |
---|---|---|
70c735e1 ET |
1 | #include "clar_libgit2.h" |
2 | #include "git2/sys/repository.h" | |
3 | ||
4 | void test_repo_new__has_nothing(void) | |
5 | { | |
6 | git_repository *repo; | |
7 | ||
8 | cl_git_pass(git_repository_new(&repo)); | |
9 | cl_assert_equal_b(true, git_repository_is_bare(repo)); | |
10 | cl_assert_equal_p(NULL, git_repository_path(repo)); | |
11 | cl_assert_equal_p(NULL, git_repository_workdir(repo)); | |
12 | git_repository_free(repo); | |
13 | } | |
14 | ||
15 | void test_repo_new__is_bare_until_workdir_set(void) | |
16 | { | |
17 | git_repository *repo; | |
18 | ||
19 | cl_git_pass(git_repository_new(&repo)); | |
20 | cl_assert_equal_b(true, git_repository_is_bare(repo)); | |
21 | ||
22 | cl_git_pass(git_repository_set_workdir(repo, clar_sandbox_path(), 0)); | |
23 | cl_assert_equal_b(false, git_repository_is_bare(repo)); | |
24 | ||
25 | git_repository_free(repo); | |
26 | } | |
27 |