mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +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
934afb85a4
commit
ba132f0200
3 changed files with 50 additions and 8 deletions
|
|
@ -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'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue