mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 01:51:46 +04:00
feat: make better error message if try-repo fails because there are no commits on the repo.
This commit is contained in:
parent
d2b61d0ef2
commit
ef638716cb
3 changed files with 34 additions and 4 deletions
|
|
@ -42,11 +42,12 @@ def git_dir(tempdir_factory):
|
|||
return path
|
||||
|
||||
|
||||
def make_repo(tempdir_factory, repo_source):
|
||||
def make_repo(tempdir_factory, repo_source, commits=True):
|
||||
path = git_dir(tempdir_factory)
|
||||
copy_tree_to_path(get_resource_path(repo_source), path)
|
||||
cmd_output('git', 'add', '.', cwd=path)
|
||||
git_commit(msg=make_repo.__name__, cwd=path)
|
||||
if commits:
|
||||
cmd_output('git', 'add', '.', cwd=path)
|
||||
git_commit(msg=make_repo.__name__, cwd=path)
|
||||
return path
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue