mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 23:05:00 +00:00
fixed indent
This commit is contained in:
parent
d0222a7129
commit
4b02f040b0
1 changed files with 13 additions and 23 deletions
|
@ -102,9 +102,7 @@ class Commands:
|
||||||
not last_commit.message.startswith("aider:")
|
not last_commit.message.startswith("aider:")
|
||||||
or last_commit.hexsha[:7] != self.coder.last_aider_commit_hash
|
or last_commit.hexsha[:7] != self.coder.last_aider_commit_hash
|
||||||
):
|
):
|
||||||
self.console.print(
|
self.console.print("[red]The last commit was not made by aider in this chat session.")
|
||||||
"[red]The last commit was not made by aider in this chat session."
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
self.coder.repo.git.reset("--hard", "HEAD~1")
|
self.coder.repo.git.reset("--hard", "HEAD~1")
|
||||||
self.console.print(
|
self.console.print(
|
||||||
|
@ -127,9 +125,7 @@ class Commands:
|
||||||
|
|
||||||
commits = f"{self.coder.last_aider_commit_hash}~1"
|
commits = f"{self.coder.last_aider_commit_hash}~1"
|
||||||
if self.coder.pretty:
|
if self.coder.pretty:
|
||||||
diff = self.coder.repo.git.diff(
|
diff = self.coder.repo.git.diff(commits, "--color", self.coder.last_aider_commit_hash)
|
||||||
commits, "--color", self.coder.last_aider_commit_hash
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
diff = self.coder.repo.git.diff(commits, self.coder.last_aider_commit_hash)
|
diff = self.coder.repo.git.diff(commits, self.coder.last_aider_commit_hash)
|
||||||
|
|
||||||
|
@ -171,14 +167,10 @@ class Commands:
|
||||||
else:
|
else:
|
||||||
self.console.print(f"[red]No files matched '{word}'")
|
self.console.print(f"[red]No files matched '{word}'")
|
||||||
for matched_file in matched_files:
|
for matched_file in matched_files:
|
||||||
abs_file_path = os.path.abspath(
|
abs_file_path = os.path.abspath(os.path.join(self.coder.root, matched_file))
|
||||||
os.path.join(self.coder.root, matched_file)
|
|
||||||
)
|
|
||||||
if abs_file_path not in self.coder.abs_fnames:
|
if abs_file_path not in self.coder.abs_fnames:
|
||||||
self.coder.abs_fnames.add(abs_file_path)
|
self.coder.abs_fnames.add(abs_file_path)
|
||||||
self.console.print(
|
self.console.print(f"[bright_black]Added {matched_file} to the chat")
|
||||||
f"[bright_black]Added {matched_file} to the chat"
|
|
||||||
)
|
|
||||||
added_fnames.append(matched_file)
|
added_fnames.append(matched_file)
|
||||||
else:
|
else:
|
||||||
self.console.print(f"[red]{matched_file} is already in the chat")
|
self.console.print(f"[red]{matched_file} is already in the chat")
|
||||||
|
@ -211,9 +203,7 @@ class Commands:
|
||||||
for matched_file in matched_files:
|
for matched_file in matched_files:
|
||||||
relative_fname = os.path.relpath(matched_file, self.coder.root)
|
relative_fname = os.path.relpath(matched_file, self.coder.root)
|
||||||
self.coder.abs_fnames.remove(matched_file)
|
self.coder.abs_fnames.remove(matched_file)
|
||||||
self.console.print(
|
self.console.print(f"[bright_black]Removed {relative_fname} from the chat")
|
||||||
f"[bright_black]Removed {relative_fname} from the chat"
|
|
||||||
)
|
|
||||||
|
|
||||||
def cmd_ls(self, args):
|
def cmd_ls(self, args):
|
||||||
"List files and show their chat status"
|
"List files and show their chat status"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue