mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Teach pre-commit try-repo to clone uncommitted changes
This commit is contained in:
parent
e04505a669
commit
bdc58cc33f
10 changed files with 148 additions and 62 deletions
|
|
@ -53,7 +53,7 @@ def make_repo(tempdir_factory, repo_source):
|
|||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def modify_manifest(path):
|
||||
def modify_manifest(path, commit=True):
|
||||
"""Modify the manifest yielded by this context to write to
|
||||
.pre-commit-hooks.yaml.
|
||||
"""
|
||||
|
|
@ -63,7 +63,8 @@ def modify_manifest(path):
|
|||
yield manifest
|
||||
with io.open(manifest_path, 'w') as manifest_file:
|
||||
manifest_file.write(ordered_dump(manifest, **C.YAML_DUMP_KWARGS))
|
||||
git_commit(msg=modify_manifest.__name__, cwd=path)
|
||||
if commit:
|
||||
git_commit(msg=modify_manifest.__name__, cwd=path)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue