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
parent 835f9c65e9
commit eba15d128b
2 changed files with 18 additions and 7 deletions

View file

@ -40,7 +40,7 @@ def _hook_paths(
hook_type: str,
git_dir: Optional[str] = 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'