We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
GIT_DIR
1 parent 0cabdbc commit 8786696Copy full SHA for 8786696
src/darker/tests/conftest.py
@@ -1,6 +1,5 @@
1
"""Configuration and fixtures for the Pytest based test suite"""
2
3
-import os
4
from pathlib import Path
5
from subprocess import check_call
6
from typing import Dict, Optional
@@ -88,7 +87,10 @@ def git_repo(tmp_path, monkeypatch):
88
87
"""Create a temporary Git repository and change current working directory into it"""
89
repository = GitRepoFixture.create_repository(tmp_path)
90
monkeypatch.chdir(tmp_path)
91
- monkeypatch.delenv("GIT_DIR")
+ # While `GitRepoFixture.create_repository()` already deletes `GIT_*` environment
+ # variables for any Git commands run by the fixture, let's explicitly remove
92
+ # `GIT_DIR` in case a test should call Git directly:
93
+ monkeypatch.delenv("GIT_DIR", raising=False)
94
return repository
95
96
0 commit comments