Commit 047fe29c4f8cd3f9554673570266b1bb9add3f46

Sim Domingo 2016-06-20T13:05:48

add failing test to include a missing config file relative to home dir

diff --git a/tests/config/include.c b/tests/config/include.c
index 882b89b..e46978b 100644
--- a/tests/config/include.c
+++ b/tests/config/include.c
@@ -108,6 +108,23 @@ void test_config_include__missing(void)
 	git_config_free(cfg);
 }
 
+void test_config_include__missing_homedir(void)
+{
+	git_config *cfg;
+	git_buf buf = GIT_BUF_INIT;
+
+	cl_git_mkfile("including", "[include]\npath = ~/.nonexistentfile\n[foo]\nbar = baz");
+
+	giterr_clear();
+	cl_git_pass(git_config_open_ondisk(&cfg, "including"));
+	cl_assert(giterr_last() == NULL);
+	cl_git_pass(git_config_get_string_buf(&buf, cfg, "foo.bar"));
+	cl_assert_equal_s("baz", git_buf_cstr(&buf));
+
+	git_buf_free(&buf);
+	git_config_free(cfg);
+}
+
 #define replicate10(s) s s s s s s s s s s
 void test_config_include__depth2(void)
 {