Add automatic addition of changes from pre-commit to the commit

This commit is contained in:
shahin 2022-08-18 10:57:09 -07:00
parent 3fe38dff05
commit 0d19b4b7fd
5 changed files with 52 additions and 4 deletions

View file

@ -215,6 +215,11 @@ def commit(repo: str = '.') -> None:
cmd_output_b(*cmd, cwd=repo, env=env)
def update_changes(repo: str = '.') -> None:
cmd = ('git', 'add', '--update')
cmd_output_b(*cmd, cwd=repo)
def git_path(name: str, repo: str = '.') -> str:
_, out, _ = cmd_output('git', 'rev-parse', '--git-path', name, cwd=repo)
return os.path.join(repo, out.strip())