mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Make git errors throw FatalError
This commit is contained in:
parent
74e878d96a
commit
e3d29a897b
2 changed files with 12 additions and 2 deletions
|
|
@ -6,6 +6,7 @@ import pytest
|
|||
from plumbum import local
|
||||
|
||||
from pre_commit import git
|
||||
from pre_commit.errors import FatalError
|
||||
from testing.fixtures import git_dir
|
||||
|
||||
|
||||
|
|
@ -24,6 +25,12 @@ def test_get_root_deeper(tmpdir_factory):
|
|||
assert git.get_root() == path
|
||||
|
||||
|
||||
def test_get_root_not_git_dir(tmpdir_factory):
|
||||
with local.cwd(tmpdir_factory.get()):
|
||||
with pytest.raises(FatalError):
|
||||
git.get_root()
|
||||
|
||||
|
||||
def test_is_not_in_merge_conflict(tmpdir_factory):
|
||||
path = git_dir(tmpdir_factory)
|
||||
with local.cwd(path):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue