Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-03-23 01:27:56 +0400
committerRussell Belfer <rb@github.com>2013-03-23 01:27:56 +0400
commit1323c6d18049163fc81e5e246e7d4e120c8de03a (patch)
treea75d2a576d38890a8c009b299ec2cb744d571282 /tests-clar/clar_libgit2.c
parent3ba01362437102501a173b9fe072a5690358baa0 (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/clar_libgit2.c')
-rw-r--r--tests-clar/clar_libgit2.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests-clar/clar_libgit2.c b/tests-clar/clar_libgit2.c
index 8033cdc3e..68d17162b 100644
--- a/tests-clar/clar_libgit2.c
+++ b/tests-clar/clar_libgit2.c
@@ -323,3 +323,11 @@ int cl_git_remove_placeholders(const char *directory_path, const char *filename)
return error;
}
+
+void cl_repo_set_bool(git_repository *repo, const char *cfg, int value)
+{
+ git_config *config;
+ cl_git_pass(git_repository_config(&config, repo));
+ cl_git_pass(git_config_set_bool(config, cfg, value != 0));
+ git_config_free(config);
+}