mirror of
https://github.com/Pythagora-io/gpt-pilot.git
synced 2026-01-09 21:27:53 -05:00
Code improvements
This commit is contained in:
@@ -204,8 +204,8 @@ class Frontend(FileDiffMixin, GitMixin, BaseAgent):
|
||||
},
|
||||
)
|
||||
|
||||
if await self.is_git_initialized() or await self.init_git_if_needed():
|
||||
await self.git_commit(commit_msg="Frontend finished")
|
||||
if self.state_manager.git_available and self.state_manager.git_used:
|
||||
await self.git_commit(commit_message="Frontend finished")
|
||||
|
||||
inputs = []
|
||||
for file in self.current_state.files:
|
||||
|
||||
@@ -89,7 +89,7 @@ class GitMixin:
|
||||
self.state_manager.git_used = True
|
||||
return True
|
||||
|
||||
async def git_commit(self, commit_msg: Optional[str] = None) -> None:
|
||||
async def git_commit(self, commit_message: Optional[str] = None) -> None:
|
||||
"""
|
||||
Create a git commit with the specified message. Commit message is optional.
|
||||
Raises RuntimeError if the commit fails.
|
||||
@@ -133,9 +133,7 @@ class GitMixin:
|
||||
if status_code != 0:
|
||||
raise RuntimeError(f"Failed to create initial commit: {stderr}")
|
||||
|
||||
if commit_msg:
|
||||
commit_message = commit_msg
|
||||
else:
|
||||
if not commit_message:
|
||||
llm = self.get_llm()
|
||||
convo = AgentConvo(self).template(
|
||||
"commit",
|
||||
|
||||
Reference in New Issue
Block a user