mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-23 22:04:59 +00:00
fixed spurious "Adding to git" messages when running aider in subdir of repo
This commit is contained in:
parent
6359376953
commit
6e9fbdcb6a
2 changed files with 30 additions and 3 deletions
|
@ -170,3 +170,27 @@ class TestRepo(unittest.TestCase):
|
|||
fnames = git_repo.get_tracked_files()
|
||||
self.assertIn(str(fname), fnames)
|
||||
self.assertIn(str(fname2), fnames)
|
||||
|
||||
def test_get_tracked_files_from_subdir(self):
|
||||
with GitTemporaryDirectory():
|
||||
# new repo
|
||||
raw_repo = git.Repo()
|
||||
|
||||
# add it, but no commits at all in the raw_repo yet
|
||||
fname = Path("subdir/new.txt")
|
||||
fname.parent.mkdir()
|
||||
fname.touch()
|
||||
raw_repo.git.add(str(fname))
|
||||
|
||||
os.chdir(fname.parent)
|
||||
|
||||
git_repo = GitRepo(InputOutput(), None, None)
|
||||
|
||||
# better be there
|
||||
fnames = git_repo.get_tracked_files()
|
||||
self.assertIn(str(fname), fnames)
|
||||
|
||||
# commit it, better still be there
|
||||
raw_repo.git.commit("-m", "new")
|
||||
fnames = git_repo.get_tracked_files()
|
||||
self.assertIn(str(fname), fnames)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue