File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,14 @@ def git_sandbox(monkeypatch: pytest.MonkeyPatch, tmp_path: Path):
23
23
monkeypatch .delenv (var )
24
24
25
25
# Define a dedicated temporary git config
26
- monkeypatch .setenv ("GIT_CONFIG_GLOBAL" , str (tmp_path / "gitconfig" ))
27
- cmd .run (f"git config --global user.name { SIGNER } " )
28
- cmd .run (f"git config --global user.email { SIGNER_MAIL } " )
26
+ gitconfig = tmp_path / ".git" / "config"
27
+ if not gitconfig .parent .exists ():
28
+ gitconfig .parent .mkdir ()
29
+ monkeypatch .setenv ("GIT_CONFIG_GLOBAL" , str (gitconfig ))
30
+ r = cmd .run (f"git config --file { gitconfig } user.name { SIGNER } " )
31
+ assert r .return_code == 0 , r .err
32
+ r = cmd .run (f"git config --file { gitconfig } user.email { SIGNER_MAIL } " )
33
+ assert r .return_code == 0 , r .err
29
34
30
35
31
36
@pytest .fixture (scope = "function" )
You can’t perform that action at this time.
0 commit comments