(git_root: str = '.')
| 74 | |
| 75 | |
| 76 | def 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 | |
| 86 | def get_git_common_dir(git_root: str = '.') -> str: |
no test coverage detected