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/diff/workdir.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/diff/workdir.c')
-rw-r--r-- | tests-clar/diff/workdir.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/tests-clar/diff/workdir.c b/tests-clar/diff/workdir.c index 983465b29..1ac56311c 100644 --- a/tests-clar/diff/workdir.c +++ b/tests-clar/diff/workdir.c @@ -472,7 +472,6 @@ void test_diff_workdir__to_index_notify_can_be_used_as_filtering_function(void) void test_diff_workdir__filemode_changes(void) { - git_config *cfg; git_diff_list *diff = NULL; diff_expects exp; int use_iterator; @@ -482,8 +481,7 @@ void test_diff_workdir__filemode_changes(void) g_repo = cl_git_sandbox_init("issue_592"); - cl_git_pass(git_repository_config(&cfg, g_repo)); - cl_git_pass(git_config_set_bool(cfg, "core.filemode", true)); + cl_repo_set_bool(g_repo, "core.filemode", true); /* test once with no mods */ @@ -530,12 +528,10 @@ void test_diff_workdir__filemode_changes(void) git_diff_list_free(diff); cl_assert(cl_toggle_filemode("issue_592/a.txt")); - git_config_free(cfg); } void test_diff_workdir__filemode_changes_with_filemode_false(void) { - git_config *cfg; git_diff_list *diff = NULL; diff_expects exp; @@ -544,8 +540,7 @@ void test_diff_workdir__filemode_changes_with_filemode_false(void) g_repo = cl_git_sandbox_init("issue_592"); - cl_git_pass(git_repository_config(&cfg, g_repo)); - cl_git_pass(git_config_set_bool(cfg, "core.filemode", false)); + cl_repo_set_bool(g_repo, "core.filemode", false); /* test once with no mods */ @@ -578,7 +573,6 @@ void test_diff_workdir__filemode_changes_with_filemode_false(void) git_diff_list_free(diff); cl_assert(cl_toggle_filemode("issue_592/a.txt")); - git_config_free(cfg); } void test_diff_workdir__head_index_and_workdir_all_differ(void) |