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

Method test_diffs_detached_head

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

Source from the content-addressed store, hash-verified

82 self.assertIn("АБВ", diffs)
83
84 def test_diffs_detached_head(self):
85 with GitTemporaryDirectory():
86 repo = git.Repo()
87 fname = Path("foo.txt")
88 fname.touch()
89 repo.git.add(str(fname))
90 repo.git.commit("-m", "foo")
91
92 fname2 = Path("bar.txt")
93 fname2.touch()
94 repo.git.add(str(fname2))
95 repo.git.commit("-m", "bar")
96
97 fname3 = Path("baz.txt")
98 fname3.touch()
99 repo.git.add(str(fname3))
100 repo.git.commit("-m", "baz")
101
102 repo.git.checkout("HEAD^")
103
104 fname.write_text("index\n")
105 repo.git.add(str(fname))
106
107 fname2.write_text("workingdir\n")
108
109 git_repo = GitRepo(InputOutput(), None, ".")
110 diffs = git_repo.get_diffs()
111 self.assertIn("index", diffs)
112 self.assertIn("workingdir", diffs)
113
114 def test_diffs_between_commits(self):
115 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