Commit be20ac5a by Russell Belfer

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.
parent 43a04135
...@@ -408,7 +408,8 @@ int cl_repo_get_bool(git_repository *repo, const char *cfg) ...@@ -408,7 +408,8 @@ int cl_repo_get_bool(git_repository *repo, const char *cfg)
int val = 0; int val = 0;
git_config *config; git_config *config;
cl_git_pass(git_repository_config(&config, repo)); 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); git_config_free(config);
return val; return val;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment