Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 95a52c7

Browse files
author
Sim Domingo
committed
add failing test to include a missing config file relative to home dir
1 parent f0ee795 commit 95a52c7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/config/include.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,23 @@ void test_config_include__missing(void)
108108
git_config_free(cfg);
109109
}
110110

111+
void test_config_include__missing_homedir(void)
112+
{
113+
git_config *cfg;
114+
git_buf buf = GIT_BUF_INIT;
115+
116+
cl_git_mkfile("including", "[include]\npath = ~/.nonexistentfile\n[foo]\nbar = baz");
117+
118+
giterr_clear();
119+
cl_git_pass(git_config_open_ondisk(&cfg, "including"));
120+
cl_assert(giterr_last() == NULL);
121+
cl_git_pass(git_config_get_string_buf(&buf, cfg, "foo.bar"));
122+
cl_assert_equal_s("baz", git_buf_cstr(&buf));
123+
124+
git_buf_free(&buf);
125+
git_config_free(cfg);
126+
}
127+
111128
#define replicate10(s) s s s s s s s s s s
112129
void test_config_include__depth2(void)
113130
{

0 commit comments

Comments
 (0)