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):
2323 monkeypatch .delenv (var )
2424
2525 # 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
2934
3035
3136@pytest .fixture (scope = "function" )
You can’t perform that action at this time.
0 commit comments