@@ -25,6 +25,8 @@ class DummyException(Exception):
2525def git_repo ():
2626 with tempfile .TemporaryDirectory () as tmp_dir :
2727 repo = Repo .init (tmp_dir , initial_branch = "main" )
28+ repo .git .config ("user.email" , "test@example.com" )
29+ repo .git .config ("user.name" , "Test User" )
2830
2931 assert repo .active_branch .name == "main"
3032
@@ -42,6 +44,8 @@ def git_repo():
4244def git_repo_with_config ():
4345 with tempfile .TemporaryDirectory () as tmp_dir :
4446 repo = Repo .init (tmp_dir , initial_branch = "main" )
47+ repo .git .config ("user.email" , "test@example.com" )
48+ repo .git .config ("user.name" , "Test User" )
4549 assert repo .active_branch .name == "main"
4650
4751 # create an empty README file and commit it
@@ -85,6 +89,8 @@ def git_repo_with_submodule():
8589 main_repo = Repo .init (main_dir , initial_branch = "main" )
8690 assert main_repo .active_branch .name == "main"
8791 open (os .path .join (main_dir , "README.md" ), "w" ).close ()
92+ main_repo .git .config ("user.email" , "test@example.com" )
93+ main_repo .git .config ("user.name" , "Test User" )
8894 main_repo .index .add (["README.md" ])
8995 main_repo .index .commit ("Initial commit" )
9096
0 commit comments