Commit bc0d1ad21e17a610dd484a8970cb2765ae8b6c8e

Jason Nader 2021-11-05T03:08:43

tests: try to init with non-existent template path

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/tests/repo/template.c b/tests/repo/template.c
index 6f369c6..99d4b6f 100644
--- a/tests/repo/template.c
+++ b/tests/repo/template.c
@@ -293,3 +293,13 @@ void test_repo_template__empty_template_path(void)
 
 	setup_repo("foo", &opts);
 }
+
+void test_repo_template__nonexistent_template_path(void)
+{
+	git_repository_init_options opts = GIT_REPOSITORY_INIT_OPTIONS_INIT;
+
+	opts.flags = GIT_REPOSITORY_INIT_MKPATH | GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE;
+	opts.template_path = "/tmp/path/that/does/not/exist/for/libgit2/test";
+
+	setup_repo("bar", &opts);
+}