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

Function get_common_dir

setup.c:312–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310}
311
312int get_common_dir(struct strbuf *sb, const char *gitdir)
313{
314 const char *git_env_common_dir = getenv(GIT_COMMON_DIR_ENVIRONMENT);
315 if (git_env_common_dir) {
316 strbuf_addstr(sb, git_env_common_dir);
317 return 1;
318 } else {
319 return get_common_dir_noenv(sb, gitdir);
320 }
321}
322
323int get_common_dir_noenv(struct strbuf *sb, const char *gitdir)
324{

Callers 6

is_git_directoryFunction · 0.85
compute_alternate_pathFunction · 0.85
clone_localFunction · 0.85
cmd_init_dbFunction · 0.85

Calls 2

strbuf_addstrFunction · 0.85
get_common_dir_noenvFunction · 0.85

Tested by

no test coverage detected