mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-03 00:43:41 +00:00
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.
This commit is contained in:
parent
adb58f7d64
commit
4536574acc
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user