mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-12 10:01:10 +00:00
repository: widen test coverage regarding initialization and configuration entries
This commit is contained in:
parent
471fa05eb7
commit
976b69bdbb
@ -166,14 +166,14 @@ void test_repo_init__additional_templates(void)
|
||||
git_buf_free(&path);
|
||||
}
|
||||
|
||||
static void assert_config_entry_on_init(const char *config_key, int expected_value)
|
||||
static void assert_config_entry_on_init_bytype(const char *config_key, int expected_value, bool is_bare)
|
||||
{
|
||||
git_config *config;
|
||||
int current_value;
|
||||
|
||||
cl_set_cleanup(&cleanup_repository, "config_entry");
|
||||
|
||||
cl_git_pass(git_repository_init(&_repo, "config_entry/test.git", 1));
|
||||
cl_git_pass(git_repository_init(&_repo, "config_entry/test.git", is_bare));
|
||||
git_repository_config(&config, _repo);
|
||||
|
||||
if (expected_value >= 0) {
|
||||
@ -189,6 +189,14 @@ static void assert_config_entry_on_init(const char *config_key, int expected_val
|
||||
git_config_free(config);
|
||||
}
|
||||
|
||||
static void assert_config_entry_on_init(const char *config_key, int expected_value)
|
||||
{
|
||||
assert_config_entry_on_init_bytype(config_key, expected_value, true);
|
||||
git_repository_free(_repo);
|
||||
|
||||
assert_config_entry_on_init_bytype(config_key, expected_value, false);
|
||||
}
|
||||
|
||||
void test_repo_init__detect_filemode(void)
|
||||
{
|
||||
#ifdef GIT_WIN32
|
||||
|
Loading…
Reference in New Issue
Block a user