Add pre-commit try-repo

`try-repo` is useful for:
- Trying out a remote hook repository without needing to configure it.
- Testing a hook repository while developing it.
This commit is contained in:
Anthony Sottile 2017-10-07 15:13:53 -07:00
parent e8641ee0a3
commit 2c88791a7f
15 changed files with 254 additions and 110 deletions

View file

@ -6,11 +6,11 @@ import tarfile
import pytest
from pre_commit import git
from pre_commit import make_archives
from pre_commit.util import cmd_output
from pre_commit.util import cwd
from testing.fixtures import git_dir
from testing.util import get_head_sha
from testing.util import skipif_slowtests_false
@ -23,7 +23,7 @@ def test_make_archive(tempdir_factory):
cmd_output('git', 'add', '.')
cmd_output('git', 'commit', '-m', 'foo')
# We'll use this sha
head_sha = get_head_sha('.')
head_sha = git.head_sha('.')
# And check that this file doesn't exist
open('bar', 'a').close()
cmd_output('git', 'add', '.')