mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
Add automatic addition of changes from pre-commit to the commit
This commit is contained in:
parent
3fe38dff05
commit
0d19b4b7fd
5 changed files with 52 additions and 4 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue