]>
git.proxmox.com Git - libgit2.git/blob - tests/worktree/config.c
1 #include "clar_libgit2.h"
2 #include "worktree_helpers.h"
4 #define COMMON_REPO "testrepo"
5 #define WORKTREE_REPO "testrepo-worktree"
7 static worktree_fixture fixture
=
8 WORKTREE_FIXTURE_INIT(COMMON_REPO
, WORKTREE_REPO
);
10 void test_worktree_config__initialize(void)
12 setup_fixture_worktree(&fixture
);
15 void test_worktree_config__cleanup(void)
17 cleanup_fixture_worktree(&fixture
);
20 void test_worktree_config__open(void)
24 cl_git_pass(git_repository_config(&cfg
, fixture
.worktree
));
25 cl_assert(cfg
!= NULL
);
30 void test_worktree_config__set(void)
35 cl_git_pass(git_repository_config(&cfg
, fixture
.worktree
));
36 cl_git_pass(git_config_set_int32(cfg
, "core.dummy", 5));
40 * reopen to verify configuration has been set in the
43 cl_git_pass(git_repository_config(&cfg
, fixture
.repo
));
44 cl_git_pass(git_config_get_int32(&val
, cfg
, "core.dummy"));
45 cl_assert_equal_i(val
, 5);