summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-05-08 14:33:37 -0700
committerRussell Belfer <rb@github.com>2014-05-08 14:33:37 -0700
commitbe20ac5a1d170aa1143bb2d1367bc224a88f54d1 (patch)
treeedbded45b3568254d4cc4404c287937a4c6b33fd
parent43a0413524fcb3b7e3405382c050a0b3c45cf257 (diff)
downloadlibgit2-be20ac5a1d170aa1143bb2d1367bc224a88f54d1.tar.gz
Allow cl_repo_get_bool to work with missing key
One of the test helpers provides a quick way for looking up a boolean key. But if the key way missing completely, the check would actually raise an error. Given the way we use this helper, if the key is missing, this should just return false, I think.
-rw-r--r--tests/clar_libgit2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/clar_libgit2.c b/tests/clar_libgit2.c
index f457adb33..b2730f4d1 100644
--- a/tests/clar_libgit2.c
+++ b/tests/clar_libgit2.c
@@ -408,7 +408,8 @@ int cl_repo_get_bool(git_repository *repo, const char *cfg)
int val = 0;
git_config *config;
cl_git_pass(git_repository_config(&config, repo));
- cl_git_pass(git_config_get_bool(&val, config, cfg));;
+ if (git_config_get_bool(&val, config, cfg) < 0)
+ giterr_clear();
git_config_free(config);
return val;
}