diff --git a/aider/main.py b/aider/main.py index 89767a3c0..4bf3142d2 100644 --- a/aider/main.py +++ b/aider/main.py @@ -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: diff --git a/tests/test_coder.py b/tests/test_coder.py index b1be19eea..4affbe0aa 100644 --- a/tests/test_coder.py +++ b/tests/test_coder.py @@ -1,4 +1,3 @@ -import os import tempfile import unittest from pathlib import Path @@ -38,7 +37,15 @@ class TestCoder(unittest.TestCase): coder.check_for_file_mentions("Please check file1.txt and file2.py") # Check if coder.abs_fnames contains both files - expected_files = {os.path.abspath("file1.txt"), os.path.abspath("file2.py")} + expected_files = set( + map( + str, + [ + Path(coder.root) / "file1.txt", + Path(coder.root) / "file2.py", + ], + ) + ) self.assertEqual(coder.abs_fnames, expected_files) def test_check_for_filename_mentions_of_longer_paths(self): @@ -50,14 +57,22 @@ class TestCoder(unittest.TestCase): # Mock the git repo mock_repo = MagicMock() - mock_repo.git.ls_files.return_value = "./file1.txt\n./file2.py" + mock_repo.git.ls_files.return_value = "file1.txt\nfile2.py" coder.repo = mock_repo # Call the check_for_file_mentions method coder.check_for_file_mentions("Please check file1.txt and file2.py") # Check if coder.abs_fnames contains both files - expected_files = {os.path.abspath("file1.txt"), os.path.abspath("file2.py")} + expected_files = set( + map( + str, + [ + Path(coder.root) / "file1.txt", + Path(coder.root) / "file2.py", + ], + ) + ) self.assertEqual(coder.abs_fnames, expected_files) def test_check_for_ambiguous_filename_mentions_of_longer_paths(self):