Commit 3db1b15e16c8501a74292855a9cb4be4c62dd929

Edward Thomson 2015-02-05T20:01:56

Merge pull request #2884 from libgit2/cmn/template-path repository: parse init.templatedir as a path

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/repository.c b/src/repository.c
index 4337544..c927507 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -1265,7 +1265,8 @@ static int repo_init_structure(
 		if (opts->template_path)
 			tdir = opts->template_path;
 		else if ((error = git_config_open_default(&cfg)) >= 0) {
-			error = git_config_get_string(&tdir, cfg, "init.templatedir");
+			if (!git_config_get_path(&template_buf, cfg, "init.templatedir"))
+				tdir = template_buf.ptr;
 			giterr_clear();
 		}