def install( config_file: str, store: Store, hook_types: Sequence[str], overwrite: bool = False, hooks: bool = False, skip_on_missing_config: bool = False, git_dir: Optional[str] = None, ) -> int: if git_dir is None and git.has_core_hookpaths_set(): logger.error( 'Cowardly refusing to install hooks with `core.hooksPath` set.\n' 'hint: `git config --unset-all core.hooksPath`', ) return 1 for hook_type in hook_types: _install_hook_script( config_file, hook_type, overwrite=overwrite, skip_on_missing_config=skip_on_missing_config, git_dir=git_dir, ) if hooks: install_hooks(config_file, store) return 0
def install( config_file, store, hook_types, overwrite=False, hooks=False, skip_on_missing_config=False, git_dir=None, ): if git.has_core_hookpaths_set(): logger.error( 'Cowardly refusing to install hooks with `core.hooksPath` set.\n' 'hint: `git config --unset-all core.hooksPath`', ) return 1 for hook_type in hook_types: _install_hook_script( config_file, hook_type, overwrite=overwrite, skip_on_missing_config=skip_on_missing_config, git_dir=git_dir, ) if hooks: install_hooks(config_file, store) return 0