MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / get_git_common_dir

Function get_git_common_dir

pre_commit/git.py:86–93  ·  view source on GitHub ↗
(git_root: str = '.')

Source from the content-addressed store, hash-verified

84
85
86def get_git_common_dir(git_root: str = '.') -> str:
87 opt = '--git-common-dir'
88 _, out, _ = cmd_output('git', 'rev-parse', opt, cwd=git_root)
89 git_common_dir = out.strip()
90 if git_common_dir != opt:
91 return os.path.normpath(os.path.join(git_root, git_common_dir))
92 else: # pragma: no cover (git < 2.5)
93 return get_git_dir(git_root)
94
95
96def is_in_merge_conflict() -> bool:

Callers

nothing calls this directly

Calls 2

cmd_outputFunction · 0.90
get_git_dirFunction · 0.85

Tested by

no test coverage detected