mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 02:21:46 +04:00
support custom core.hooksPath
This commit is contained in:
parent
40e21bb8ba
commit
1c8fe57b66
3 changed files with 37 additions and 11 deletions
|
|
@ -6,6 +6,7 @@ from typing import List
|
|||
from typing import MutableMapping
|
||||
from typing import Optional
|
||||
from typing import Set
|
||||
from typing import Tuple
|
||||
|
||||
from pre_commit.errors import FatalError
|
||||
from pre_commit.util import CalledProcessError
|
||||
|
|
@ -176,9 +177,9 @@ def has_diff(*args: str, repo: str = '.') -> bool:
|
|||
return cmd_output_b(*cmd, cwd=repo, retcode=None)[0] == 1
|
||||
|
||||
|
||||
def has_core_hookpaths_set() -> bool:
|
||||
def has_core_hookpaths_set() -> Tuple[bool, str]:
|
||||
_, out, _ = cmd_output_b('git', 'config', 'core.hooksPath', retcode=None)
|
||||
return bool(out.strip())
|
||||
return bool(out.strip()), out.strip().decode()
|
||||
|
||||
|
||||
def init_repo(path: str, remote: str) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue