File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ #include "clar_libgit2.h"
2+
3+ #include "repository.h"
4+
5+ static git_repository * g_repo ;
6+
7+ void test_refs_namespaces__initialize (void )
8+ {
9+ g_repo = cl_git_sandbox_init ("testrepo" );
10+ }
11+
12+ void test_refs_namespaces__cleanup (void )
13+ {
14+ cl_git_sandbox_cleanup ();
15+ }
16+
17+ void test_refs_namespaces__get_and_set (void )
18+ {
19+ cl_assert_equal_s (NULL , git_repository_get_namespace (g_repo ));
20+
21+ cl_git_pass (git_repository_set_namespace (g_repo , "namespace" ));
22+ cl_assert_equal_s ("namespace" , git_repository_get_namespace (g_repo ));
23+
24+ cl_git_pass (git_repository_set_namespace (g_repo , NULL ));
25+ cl_assert_equal_s (NULL , git_repository_get_namespace (g_repo ));
26+ }
27+
28+ void test_refs_namespaces__namespace_doesnt_show_normal_refs (void )
29+ {
30+ static git_strarray ref_list ;
31+
32+ cl_git_pass (git_repository_set_namespace (g_repo , "namespace" ));
33+ cl_git_pass (git_reference_list (& ref_list , g_repo ));
34+ cl_assert_equal_i (0 , ref_list .count );
35+ git_strarray_free (& ref_list );
36+ }
You can’t perform that action at this time.
0 commit comments