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

Method check_for_dirty_commit

aider/coders/base_coder.py:2175–2189  ·  view source on GitHub ↗
(self, path)

Source from the content-addressed store, hash-verified

2173 return all_files - inchat_files - read_only_files
2174
2175 def check_for_dirty_commit(self, path):
2176 if not self.repo:
2177 return
2178 if not self.dirty_commits:
2179 return
2180 if not self.repo.is_dirty(path):
2181 return
2182
2183 # We need a committed copy of the file in order to /undo, so skip this
2184 # fullp = Path(self.abs_root_path(path))
2185 # if not fullp.stat().st_size:
2186 # return
2187
2188 self.io.tool_output(f"Committing {path} before applying edits.")
2189 self.need_commit_before_edits.add(path)
2190
2191 def allowed_to_edit(self, path):
2192 full_path = self.abs_root_path(path)

Callers 1

allowed_to_editMethod · 0.95

Calls 2

is_dirtyMethod · 0.80
tool_outputMethod · 0.45

Tested by

no test coverage detected