Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Fultz <jfultz@wolfram.com>2014-11-01 19:21:45 +0300
committerJohn Fultz <jfultz@wolfram.com>2014-11-01 19:21:45 +0300
commit727ae380a5de63e7b5856abb1f4dd191e2d5b678 (patch)
tree30ff95bab81c442c7d89a36fe505e97fd1da1c62 /tests/config/include.c
parent264d74fd4088585fa9fb6ffd6d9afe280c0048bb (diff)
Make config reading continue after hitting a missing include file.
For example, if you have [include] path = foo and foo didn't exist, git_config_open_ondisk() would just give up on the rest of the file. Now it ignores the unresolved include without error and continues reading the rest of the file.
Diffstat (limited to 'tests/config/include.c')
-rw-r--r--tests/config/include.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/config/include.c b/tests/config/include.c
index 167814e59..b98252d1c 100644
--- a/tests/config/include.c
+++ b/tests/config/include.c
@@ -86,3 +86,18 @@ void test_config_include__depth(void)
unlink("a");
unlink("b");
}
+
+void test_config_include__missing(void)
+{
+ git_config *cfg;
+ const char *str;
+
+ cl_git_mkfile("included", "[include]\npath = nonexistentfile\n[foo]\nbar = baz");
+
+ cl_git_pass(git_config_open_ondisk(&cfg, "included"));
+ cl_git_pass(git_config_get_string(&str, cfg, "foo.bar"));
+ cl_assert_equal_s(str, "baz");
+
+ git_config_free(cfg);
+ unlink("included");
+}