Commit 3ea78f24 by Yury G. Kudryashov

Add test for include.path inside included config

It fails at least on my computer, though it may depend on some unpredictable
factors (say, will realloc() extend the memory segment in place, or it will
allocate new memory).
parent b703049c
......@@ -102,3 +102,25 @@ void test_config_include__missing(void)
git_config_free(cfg);
}
#define replicate10(s) s s s s s s s s s s
void test_config_include__depth2(void)
{
git_config *cfg;
const char *str;
const char *content = "[include]\n" replicate10(replicate10("path=bottom\n"));
cl_git_mkfile("top-level", "[include]\npath = middle\n[foo]\nbar = baz");
cl_git_mkfile("middle", content);
cl_git_mkfile("bottom", "[foo]\nbar2 = baz2");
cl_git_pass(git_config_open_ondisk(&cfg, "top-level"));
cl_git_pass(git_config_get_string(&str, cfg, "foo.bar"));
cl_assert_equal_s(str, "baz");
cl_git_pass(git_config_get_string(&str, cfg, "foo.bar2"));
cl_assert_equal_s(str, "baz2");
git_config_free(cfg);
}
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