mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 10:31:46 +04:00
change the HOME for git commands to avoid using the user git configuration
This commit is contained in:
parent
9e193f7fc8
commit
5b472b30eb
2 changed files with 10 additions and 5 deletions
|
|
@ -39,6 +39,11 @@ def tempdir_factory(tmpdir):
|
|||
yield TmpdirFactory()
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def setup_git(monkeypatch, tmpdir):
|
||||
# we should not use user configuration
|
||||
monkeypatch.setenv('HOME', tmpdir)
|
||||
|
||||
@pytest.yield_fixture
|
||||
def in_tmpdir(tempdir_factory):
|
||||
path = tempdir_factory.get()
|
||||
|
|
@ -67,7 +72,7 @@ def _make_conflict():
|
|||
|
||||
|
||||
@pytest.yield_fixture
|
||||
def in_merge_conflict(tempdir_factory):
|
||||
def in_merge_conflict(tempdir_factory, setup_git):
|
||||
path = make_consuming_repo(tempdir_factory, 'script_hooks_repo')
|
||||
with cwd(path):
|
||||
open('dummy', 'a').close()
|
||||
|
|
@ -82,7 +87,7 @@ def in_merge_conflict(tempdir_factory):
|
|||
|
||||
|
||||
@pytest.yield_fixture
|
||||
def in_conflicting_submodule(tempdir_factory):
|
||||
def in_conflicting_submodule(tempdir_factory, setup_git):
|
||||
git_dir_1 = git_dir(tempdir_factory)
|
||||
git_dir_2 = git_dir(tempdir_factory)
|
||||
with cwd(git_dir_2):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue