MCPcopy Create free account
hub / github.com/git/git / template_dir_cb

Function template_dir_cb

setup.c:2229–2248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2227};
2228
2229static 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
2250const char *get_template_dir(const char *option_template)
2251{

Callers

nothing calls this directly

Calls 2

git_config_pathnameFunction · 0.85
xstrdupFunction · 0.85

Tested by

no test coverage detected