mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
Merge e17c746d66 into d6cf62532d
This commit is contained in:
commit
36b857c849
1 changed files with 4 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ from __future__ import unicode_literals
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
|
import subprocess
|
||||||
|
|
||||||
from cached_property import cached_property
|
from cached_property import cached_property
|
||||||
|
|
||||||
|
|
@ -44,7 +45,9 @@ class Runner(object):
|
||||||
return repositories
|
return repositories
|
||||||
|
|
||||||
def get_hook_path(self, hook_type):
|
def get_hook_path(self, hook_type):
|
||||||
return os.path.join(self.git_root, '.git', 'hooks', hook_type)
|
git_dir = subprocess.check_output('git rev-parse --git-dir',
|
||||||
|
shell=True)
|
||||||
|
return os.path.join(git_dir.strip(), 'hooks', hook_type)
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def pre_commit_path(self):
|
def pre_commit_path(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue