Split get_git_dir() into get_git_dir() and get_git_common_dir()

This fixes the conflicted state check when using work trees. #1972
This commit is contained in:
Daniel Schürmann 2021-07-11 07:59:33 +02:00 committed by Anthony Sottile
parent 934afb85a4
commit ba132f0200
3 changed files with 50 additions and 8 deletions

View file

@ -36,7 +36,7 @@ def _hook_paths(
hook_type: str,
git_dir: str | None = None,
) -> tuple[str, str]:
git_dir = git_dir if git_dir is not None else git.get_git_dir()
git_dir = git_dir if git_dir is not None else git.get_git_common_dir()
pth = os.path.join(git_dir, 'hooks', hook_type)
return pth, f'{pth}.legacy'