diff options
| author | Russell Belfer <rb@github.com> | 2013-03-22 14:27:56 -0700 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2013-03-22 14:27:56 -0700 |
| commit | 1323c6d18049163fc81e5e246e7d4e120c8de03a (patch) | |
| tree | a75d2a576d38890a8c009b299ec2cb744d571282 /tests-clar/clar_libgit2.c | |
| parent | 3ba01362437102501a173b9fe072a5690358baa0 (diff) | |
| download | libgit2-1323c6d18049163fc81e5e246e7d4e120c8de03a.tar.gz | |
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.c | 8 |
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); +} |
