| 2227 | }; |
| 2228 | |
| 2229 | static int template_dir_cb(const char *key, const char *value, |
| 2230 | const struct config_context *ctx UNUSED, void *d) |
| 2231 | { |
| 2232 | struct template_dir_cb_data *data = d; |
| 2233 | |
| 2234 | if (strcmp(key, "init.templatedir")) |
| 2235 | return 0; |
| 2236 | |
| 2237 | if (!value) { |
| 2238 | data->path = NULL; |
| 2239 | } else { |
| 2240 | char *path = NULL; |
| 2241 | |
| 2242 | FREE_AND_NULL(data->path); |
| 2243 | if (!git_config_pathname(&path, key, value)) |
| 2244 | data->path = path ? path : xstrdup(value); |
| 2245 | } |
| 2246 | |
| 2247 | return 0; |
| 2248 | } |
| 2249 | |
| 2250 | const char *get_template_dir(const char *option_template) |
| 2251 | { |
nothing calls this directly
no test coverage detected