Implement our own rev-parse --top-level

This commit is contained in:
Anthony Sottile 2014-03-14 14:50:04 -07:00
parent 086e50728d
commit bf457349b3
2 changed files with 15 additions and 0 deletions

View file

@ -10,6 +10,7 @@ from pre_commit import git
def get_pre_commit_dir_path():
return os.path.join(git.get_root(), C.HOOKS_WORKSPACE)
@contextlib.contextmanager
def in_hooks_workspace():
"""Change into the hooks workspace. If it does not exist create it."""