mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Migrate sha -> rev
This commit is contained in:
parent
184e22e81f
commit
5651c66995
19 changed files with 215 additions and 107 deletions
|
|
@ -78,11 +78,11 @@ def config_with_local_hooks():
|
|||
))
|
||||
|
||||
|
||||
def make_config_from_repo(repo_path, sha=None, hooks=None, check=True):
|
||||
def make_config_from_repo(repo_path, rev=None, hooks=None, check=True):
|
||||
manifest = load_manifest(os.path.join(repo_path, C.MANIFEST_FILE))
|
||||
config = OrderedDict((
|
||||
('repo', 'file://{}'.format(repo_path)),
|
||||
('sha', sha or git.head_sha(repo_path)),
|
||||
('rev', rev or git.head_rev(repo_path)),
|
||||
(
|
||||
'hooks',
|
||||
hooks or [OrderedDict((('id', hook['id']),)) for hook in manifest],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue