diff options
author | Russell Belfer <rb@github.com> | 2013-03-23 01:27:56 +0400 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-03-23 01:27:56 +0400 |
commit | 1323c6d18049163fc81e5e246e7d4e120c8de03a (patch) | |
tree | a75d2a576d38890a8c009b299ec2cb744d571282 /tests-clar/index/filemodes.c | |
parent | 3ba01362437102501a173b9fe072a5690358baa0 (diff) |
Add cl_repo_set_bool and cleanup tests
This adds a helper function for the cases where you want to
quickly set a single boolean config value for a repository.
This allowed me to remove a lot of code.
Diffstat (limited to 'tests-clar/index/filemodes.c')
-rw-r--r-- | tests-clar/index/filemodes.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/tests-clar/index/filemodes.c b/tests-clar/index/filemodes.c index 1bb44173c..e56a9c069 100644 --- a/tests-clar/index/filemodes.c +++ b/tests-clar/index/filemodes.c @@ -66,13 +66,10 @@ static void add_and_check_mode( void test_index_filemodes__untrusted(void) { - git_config *cfg; git_index *index; bool can_filemode = cl_is_chmod_supported(); - cl_git_pass(git_repository_config(&cfg, g_repo)); - cl_git_pass(git_config_set_bool(cfg, "core.filemode", false)); - git_config_free(cfg); + cl_repo_set_bool(g_repo, "core.filemode", false); cl_git_pass(git_repository_index(&index, g_repo)); cl_assert((git_index_caps(index) & GIT_INDEXCAP_NO_FILEMODE) != 0); @@ -113,7 +110,6 @@ void test_index_filemodes__untrusted(void) void test_index_filemodes__trusted(void) { - git_config *cfg; git_index *index; /* Only run these tests on platforms where I can actually @@ -122,9 +118,7 @@ void test_index_filemodes__trusted(void) if (!cl_is_chmod_supported()) return; - cl_git_pass(git_repository_config(&cfg, g_repo)); - cl_git_pass(git_config_set_bool(cfg, "core.filemode", true)); - git_config_free(cfg); + cl_repo_set_bool(g_repo, "core.filemode", true); cl_git_pass(git_repository_index(&index, g_repo)); cl_assert((git_index_caps(index) & GIT_INDEXCAP_NO_FILEMODE) == 0); |