def make_repo(tempdir_factory, repo_source): path = git_dir(tempdir_factory) copy_tree_to_path(get_resource_path(repo_source), path) with cwd(path): cmd_output('git', 'add', '.') cmd_output('git', 'commit', '-m', 'Add hooks') return path
def make_local_strategy(directory): copy_tree_to_path(resource_filename('empty_template'), directory) env = no_git_env() name, email = 'pre-commit', '*****@*****.**' env['GIT_AUTHOR_NAME'] = env['GIT_COMMITTER_NAME'] = name env['GIT_AUTHOR_EMAIL'] = env['GIT_COMMITTER_EMAIL'] = email # initialize the git repository so it looks more like cloned repos def _git_cmd(*args): cmd_output('git', '-C', directory, *args, env=env) _git_cmd('init', '.') _git_cmd('config', 'remote.origin.url', '<<unknown>>') _git_cmd('add', '.') _git_cmd('commit', '--no-edit', '--no-gpg-sign', '-n', '-minit')
def make_local_strategy(directory): copy_tree_to_path(resource_filename('empty_template'), directory)