diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2013-09-07 21:07:39 +0400 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-09-07 22:51:26 +0400 |
commit | 53ea0513716a8d1e1bc1347cca5a333e26ca9f1e (patch) | |
tree | 0b2f16f134d956d27d7b9004ec9949fbdcdbe3f0 /tests-clar/config | |
parent | 69789922984d2e22f267da5f35cd64cd17c36dc0 (diff) |
config: handle realloc issues from larger depths
As the include depth increases, the chance of a realloc
increases. This means that whenever we run git_array_alloc() or call
config_parse(), we need to remember what our reader's index is so we
can look it up again.
Diffstat (limited to 'tests-clar/config')
-rw-r--r-- | tests-clar/config/include.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests-clar/config/include.c b/tests-clar/config/include.c index f1019a9dc..535573808 100644 --- a/tests-clar/config/include.c +++ b/tests-clar/config/include.c @@ -93,3 +93,17 @@ void test_config_include__ordering(void) git_config_free(cfg); } + +/* We need to pretend that the variables were defined where the file was included */ +void test_config_include__depth(void) +{ + git_config *cfg; + + cl_git_mkfile("a", "[include]\npath = b"); + cl_git_mkfile("b", "[include]\npath = a"); + + cl_git_fail(git_config_open_ondisk(&cfg, "a")); + + unlink("a"); + unlink("b"); +} |