Fix #238 : pre-commit autoupdate fails with local hooks

This commit is contained in:
Lucas Cimon 2015-06-02 21:43:30 +02:00
parent 1c46446427
commit b575cb510c
5 changed files with 30 additions and 14 deletions

View file

@ -35,6 +35,19 @@ def make_repo(tmpdir_factory, repo_source):
return path
def config_with_local_hooks():
return OrderedDict((
('repo', 'local'),
('hooks', [OrderedDict((
('id', 'do_not_commit'),
('name', 'Block if "DO NOT COMMIT" is found'),
('entry', 'DO NOT COMMIT'),
('language', 'pcre'),
('files', '^(.*)$'),
))])
))
def make_config_from_repo(repo_path, sha=None, hooks=None, check=True):
manifest = load_manifest(os.path.join(repo_path, C.MANIFEST_FILE))
config = OrderedDict((