summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-05-05 16:29:38 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-06-22 17:02:55 +0200
commit4536574acc85d8c78ceeac872eed6e4f79ef9aaa (patch)
treeb9cf6788d36aef1d2b729fc1efac6f1f2c4caeef
parentadb58f7d646091f835d900867e22cb8329799dd2 (diff)
downloadlibgit2-4536574acc85d8c78ceeac872eed6e4f79ef9aaa.tar.gz
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.
-rw-r--r--tests/submodule/modify.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/submodule/modify.c b/tests/submodule/modify.c
index 77f86e514..81c34de46 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 */