mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 02:34:59 +00:00
Refactor git file tracking in Coder class.
This commit is contained in:
parent
a711debd1d
commit
9567be8c6a
1 changed files with 5 additions and 4 deletions
|
@ -411,10 +411,11 @@ class Coder:
|
||||||
self.abs_fnames.add(full_path)
|
self.abs_fnames.add(full_path)
|
||||||
|
|
||||||
# Check if the file is already in the repo
|
# Check if the file is already in the repo
|
||||||
tracked_files = set(self.repo.git.ls_files().splitlines())
|
if self.repo:
|
||||||
relative_fname = self.get_rel_fname(full_path)
|
tracked_files = set(self.repo.git.ls_files().splitlines())
|
||||||
if relative_fname not in tracked_files and self.repo and self.io.confirm_ask(f"Add {path} to git?"):
|
relative_fname = self.get_rel_fname(full_path)
|
||||||
self.repo.git.add(full_path)
|
if relative_fname not in tracked_files and self.io.confirm_ask(f"Add {path} to git?"):
|
||||||
|
self.repo.git.add(full_path)
|
||||||
|
|
||||||
edited.add(path)
|
edited.add(path)
|
||||||
if utils.do_replace(full_path, original, updated):
|
if utils.do_replace(full_path, original, updated):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue