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

Function get_git_dir

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

Source from the content-addressed store, hash-verified

74
75
76def get_git_dir(git_root: str = '.') -> str:
77 opt = '--git-dir'
78 _, out, _ = cmd_output('git', 'rev-parse', opt, cwd=git_root)
79 git_dir = out.strip()
80 if git_dir != opt:
81 return os.path.normpath(os.path.join(git_root, git_dir))
82 else:
83 raise AssertionError('unreachable: no git dir')
84
85
86def get_git_common_dir(git_root: str = '.') -> str:

Callers 3

get_git_common_dirFunction · 0.85
is_in_merge_conflictFunction · 0.85
get_conflicted_filesFunction · 0.85

Calls 1

cmd_outputFunction · 0.90

Tested by

no test coverage detected