Commit 4536574a by Carlos Martín Nieto

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.
parent adb58f7d
...@@ -41,10 +41,10 @@ void test_submodule_modify__init(void) ...@@ -41,10 +41,10 @@ void test_submodule_modify__init(void)
git_config_free(cfg); git_config_free(cfg);
/* confirm no submodule data in config */ /* confirm no submodule data in config */
cl_git_pass(git_repository_config(&cfg, g_repo)); cl_git_pass(git_repository_config_snapshot(&cfg, g_repo));
cl_git_fail(git_config_get_string(&str, cfg, "submodule.sm_unchanged.url")); cl_git_fail_with(GIT_ENOTFOUND, 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_with(GIT_ENOTFOUND, 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_fail_with(GIT_ENOTFOUND, git_config_get_string(&str, cfg, "submodule.sm_added_and_uncommited.url"));
git_config_free(cfg); git_config_free(cfg);
/* call init and see that settings are copied */ /* call init and see that settings are copied */
......
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