mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Support pre-commit from inside submodules
This commit is contained in:
parent
d6cf62532d
commit
c3c98afe4f
7 changed files with 92 additions and 26 deletions
|
|
@ -30,6 +30,10 @@ class Runner(object):
|
|||
os.chdir(root)
|
||||
return cls(root)
|
||||
|
||||
@cached_property
|
||||
def git_dir(self):
|
||||
return git.get_git_dir(self.git_root)
|
||||
|
||||
@cached_property
|
||||
def config_file_path(self):
|
||||
return os.path.join(self.git_root, C.CONFIG_FILE)
|
||||
|
|
@ -44,7 +48,7 @@ class Runner(object):
|
|||
return repositories
|
||||
|
||||
def get_hook_path(self, hook_type):
|
||||
return os.path.join(self.git_root, '.git', 'hooks', hook_type)
|
||||
return os.path.join(self.git_dir, 'hooks', hook_type)
|
||||
|
||||
@cached_property
|
||||
def pre_commit_path(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue