mounting the superproject directory

This commit is contained in:
Ilya Epifanov 2019-05-08 13:50:25 +02:00
parent c2980217a8
commit 69709798c6
2 changed files with 14 additions and 3 deletions

View file

@ -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)