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

Function is_inside_work_tree

setup.c:480–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478}
479
480int is_inside_work_tree(struct repository *repo)
481{
482 struct strbuf buf = STRBUF_INIT;
483 const char *worktree;
484 int ret;
485
486 worktree = repo_get_work_tree(repo);
487 if (!worktree)
488 return 0;
489
490 ret = is_inside_dir(strbuf_realpath(&buf, worktree, 1));
491
492 strbuf_release(&buf);
493 return ret;
494}
495
496void setup_work_tree(struct repository *repo)
497{

Callers 5

verify_non_filenameFunction · 0.85
resolve_relative_pathFunction · 0.85
cmd_ls_filesFunction · 0.85
cmd_rev_parseFunction · 0.85

Calls 4

repo_get_work_treeFunction · 0.85
is_inside_dirFunction · 0.85
strbuf_realpathFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected