mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 10:31:46 +04:00
mounting the superproject directory
This commit is contained in:
parent
c2980217a8
commit
69709798c6
2 changed files with 14 additions and 3 deletions
|
|
@ -39,6 +39,14 @@ def get_root():
|
|||
return cmd_output('git', 'rev-parse', '--show-toplevel')[1].strip()
|
||||
|
||||
|
||||
def get_superproject_root():
|
||||
stdout = cmd_output('git',
|
||||
'rev-parse',
|
||||
'--show-superproject-working-tree',
|
||||
'--show-toplevel')
|
||||
return stdout[1].splitlines()[0].strip()
|
||||
|
||||
|
||||
def get_git_dir(git_root='.'):
|
||||
opts = ('--git-common-dir', '--git-dir')
|
||||
_, out, _ = cmd_output('git', 'rev-parse', *opts, cwd=git_root)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue