mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 06:15:00 +00:00
Refactor set_repo() to add check_for_local_edits() and remove duplicated code in commit() to rely on self.repo.
This commit is contained in:
parent
5afeb29c94
commit
880e90566d
1 changed files with 1 additions and 10 deletions
11
coder.py
11
coder.py
|
@ -453,16 +453,7 @@ class Coder:
|
|||
return res
|
||||
|
||||
def commit(self, history=None, prefix=None, ask=False):
|
||||
repo_paths = set(
|
||||
git.Repo(fname, search_parent_directories=True).git_dir
|
||||
for fname in self.fnames
|
||||
)
|
||||
|
||||
if len(repo_paths) > 1:
|
||||
repo_paths = " ".join(repo_paths)
|
||||
raise ValueError(f"Files must all be in one git repo, not: {repo_paths}")
|
||||
|
||||
repo = git.Repo(repo_paths.pop())
|
||||
repo = self.repo
|
||||
if not repo.is_dirty():
|
||||
return
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue