Skip to content

Commit 5c3e722

Browse files
committed
#85: Fix propagation of commit hashes in the case of running a command with /code from another top level Coder class variant
1 parent 9f952a8 commit 5c3e722

3 files changed

Lines changed: 7 additions & 11 deletions

File tree

aider/commands.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,19 +1493,12 @@ async def _generic_chat_command(self, args, edit_format, placeholder=None):
14931493
edit_format=edit_format,
14941494
summarize_from_coder=False,
14951495
num_cache_warming_pings=0,
1496+
aider_commit_hashes=self.coder.aider_commit_hashes,
14961497
)
14971498

14981499
user_msg = args
1499-
await coder.run(user_msg)
1500-
1501-
# Use the provided placeholder if any
1502-
raise SwitchCoder(
1503-
edit_format=self.coder.edit_format,
1504-
summarize_from_coder=False,
1505-
from_coder=coder,
1506-
show_announcements=False,
1507-
placeholder=placeholder,
1508-
)
1500+
await coder.run(user_msg, False)
1501+
self.coder.aider_commit_hashes = coder.aider_commit_hashes
15091502

15101503
def get_help_md(self):
15111504
"Show help about all commands in markdown"

aider/io.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,9 @@ def _tool_message(self, message="", strip=True, color=None):
12601260
message = str(message).encode("ascii", errors="replace").decode("ascii")
12611261
self.stream_print(message, style=style)
12621262

1263+
def tool_success(self, message="", strip=True):
1264+
self._tool_message(message, strip, self.user_input_color)
1265+
12631266
def tool_error(self, message="", strip=True):
12641267
self.num_error_outputs += 1
12651268
self._tool_message(message, strip, self.tool_error_color)

aider/repo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ async def commit(self, fnames=None, context=None, message=None, aider_edits=Fals
310310
# Perform the commit
311311
self.repo.git.commit(cmd)
312312
commit_hash = self.get_head_commit_sha(short=True)
313-
self.io.tool_output(f"Commit {commit_hash} {commit_message}", bold=True)
313+
self.io.tool_success(f"Commit {commit_hash} {commit_message}")
314314
return commit_hash, commit_message
315315

316316
except ANY_GIT_ERROR as err:

0 commit comments

Comments
 (0)