submodule: test more accurately for non-existence The current code will always fail, but only because it's asking for a string on a live config. Take a snapshot and make sure we fail with ENOTFOUND instead of any old error.
diff --git a/tests/submodule/modify.c b/tests/submodule/modify.c
index 77f86e5..81c34de 100644
--- a/tests/submodule/modify.c
+++ b/tests/submodule/modify.c
@@ -41,10 +41,10 @@ void test_submodule_modify__init(void)
git_config_free(cfg);
/* confirm no submodule data in config */
- cl_git_pass(git_repository_config(&cfg, g_repo));
- cl_git_fail(git_config_get_string(&str, cfg, "submodule.sm_unchanged.url"));
- cl_git_fail(git_config_get_string(&str, cfg, "submodule.sm_changed_head.url"));
- cl_git_fail(git_config_get_string(&str, cfg, "submodule.sm_added_and_uncommited.url"));
+ cl_git_pass(git_repository_config_snapshot(&cfg, g_repo));
+ cl_git_fail_with(GIT_ENOTFOUND, git_config_get_string(&str, cfg, "submodule.sm_unchanged.url"));
+ cl_git_fail_with(GIT_ENOTFOUND, git_config_get_string(&str, cfg, "submodule.sm_changed_head.url"));
+ cl_git_fail_with(GIT_ENOTFOUND, git_config_get_string(&str, cfg, "submodule.sm_added_and_uncommited.url"));
git_config_free(cfg);
/* call init and see that settings are copied */