mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 02:21:46 +04:00
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:
parent
835f9c65e9
commit
eba15d128b
2 changed files with 18 additions and 7 deletions
|
|
@ -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'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue