MCPcopy
hub / github.com/Aider-AI/aider / test_diffs_nonempty_repo

Method test_diffs_nonempty_repo

tests/basic/test_repo.py:39–60  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

37 self.assertIn("workingdir", diffs)
38
39 def test_diffs_nonempty_repo(self):
40 with GitTemporaryDirectory():
41 repo = git.Repo()
42 fname = Path("foo.txt")
43 fname.touch()
44 repo.git.add(str(fname))
45
46 fname2 = Path("bar.txt")
47 fname2.touch()
48 repo.git.add(str(fname2))
49
50 repo.git.commit("-m", "initial")
51
52 fname.write_text("index\n")
53 repo.git.add(str(fname))
54
55 fname2.write_text("workingdir\n")
56
57 git_repo = GitRepo(InputOutput(), None, ".")
58 diffs = git_repo.get_diffs()
59 self.assertIn("index", diffs)
60 self.assertIn("workingdir", diffs)
61
62 def test_diffs_with_single_byte_encoding(self):
63 with GitTemporaryDirectory():

Callers

nothing calls this directly

Calls 6

get_diffsMethod · 0.95
GitRepoClass · 0.90
InputOutputClass · 0.90
commitMethod · 0.80
write_textMethod · 0.80

Tested by

no test coverage detected