provide default git name/email; fix tests

This commit is contained in:
Paul Gauthier 2023-07-07 15:02:56 -07:00
parent 451929f2ca
commit 031c2bc34b
2 changed files with 25 additions and 6 deletions

View file

@ -265,9 +265,13 @@ def main(args=None, input=None, output=None):
repo = git.Repo.init(os.getcwd())
with repo.config_writer() as git_config:
if not git_config.has_option("user", "name"):
git_config.set_value("user", "name", "Example Name")
git_config.set_value("user", "name", "Your Name")
io.tool_error('Update git name with: git config --global user.name "Your Name"')
if not git_config.has_option("user", "email"):
git_config.set_value("user", "email", "example.email@example.com")
git_config.set_value("user", "email", "you@example.com")
io.tool_error(
'Update git email with: git config --global user.email "you@example.com"'
)
io.tool_output("Git repository created in the current working directory.")
if args.verbose: