mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
Teach pre-commit try-repo to clone uncommitted changes
This commit is contained in:
parent
e04505a669
commit
bdc58cc33f
10 changed files with 148 additions and 62 deletions
|
|
@ -9,6 +9,7 @@ import pytest
|
|||
|
||||
import pre_commit.constants as C
|
||||
from pre_commit import main
|
||||
from pre_commit.error_handler import FatalError
|
||||
from testing.auto_namedtuple import auto_namedtuple
|
||||
|
||||
|
||||
|
|
@ -19,6 +20,11 @@ class Args(object):
|
|||
self.__dict__.update(kwargs)
|
||||
|
||||
|
||||
def test_adjust_args_and_chdir_not_in_git_dir(in_tmpdir):
|
||||
with pytest.raises(FatalError):
|
||||
main._adjust_args_and_chdir(Args())
|
||||
|
||||
|
||||
def test_adjust_args_and_chdir_noop(in_git_dir):
|
||||
args = Args(command='run', files=['f1', 'f2'])
|
||||
main._adjust_args_and_chdir(args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue