Commit fc0ee5bdd384f6f9a6cf1ca1e09d9578fe72fdbd

Carlos Martín Nieto 2011-05-31T17:54:50

Add test for empty config file Signed-off-by: Carlos Martín Nieto <cmn@elego.de>

diff --git a/tests/resources/config/config8 b/tests/resources/config/config8
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/resources/config/config8
diff --git a/tests/t15-config.c b/tests/t15-config.c
index 4a3c0dc..08a2cdb 100644
--- a/tests/t15-config.c
+++ b/tests/t15-config.c
@@ -181,6 +181,14 @@ BEGIN_TEST(config7, "test for invalid ext headers")
 
 END_TEST
 
+BEGIN_TEST(config8, "don't fail on empty files")
+	git_config *cfg;
+
+	must_pass(git_config_open_file(&cfg, CONFIG_BASE "/config8"));
+
+	git_config_free(cfg);
+END_TEST
+
 BEGIN_SUITE(config)
 	 ADD_TEST(config0);
 	 ADD_TEST(config1);
@@ -190,4 +198,5 @@ BEGIN_SUITE(config)
 	 ADD_TEST(config5);
 	 ADD_TEST(config6);
 	 ADD_TEST(config7);
+	 ADD_TEST(config8);
 END_SUITE