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

Function get_template_dir

setup.c:2250–2273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2248}
2249
2250const char *get_template_dir(const char *option_template)
2251{
2252 const char *template_dir = option_template;
2253
2254 if (!template_dir)
2255 template_dir = getenv(TEMPLATE_DIR_ENVIRONMENT);
2256 if (!template_dir) {
2257 static struct template_dir_cb_data data;
2258
2259 if (!data.initialized) {
2260 git_protected_config(template_dir_cb, &data);
2261 data.initialized = 1;
2262 }
2263 template_dir = data.path;
2264 }
2265 if (!template_dir) {
2266 static char *dir;
2267
2268 if (!dir)
2269 dir = system_path(DEFAULT_GIT_TEMPLATE_DIR);
2270 template_dir = dir;
2271 }
2272 return template_dir;
2273}
2274
2275#ifdef NO_TRUSTABLE_FILEMODE
2276#define TEST_FILEMODE 0

Callers 1

copy_templatesFunction · 0.85

Calls 2

git_protected_configFunction · 0.85
system_pathFunction · 0.85

Tested by

no test coverage detected