8000 Fix: Insufficient quoting of git commit message by klieret · Pull Request #646 · SWE-agent/SWE-agent · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix: Insufficient quoting of git commit message #646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8000
Merged
merged 1 commit into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion sweagent/environment/swe_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import random
import re
import shlex
import subprocess
import time
import traceback
Expand Down Expand Up @@ -1118,8 +1119,12 @@ def open_pr(self, *, trajectory, _dry_run: bool = False):
timeout_duration=10,
)
dry_run_flag = "--allow-empty" if _dry_run else ""
commit_msg = [
shlex.quote("Fix: {issue.title}"),
shlex.quote("Closes #{issue.number}"),
]
self.communicate_with_handling(
input=f"git commit -m 'Fix: {issue.title}' -m 'Closes #{issue.number}' {dry_run_flag}",
input=f"git commit -m {commit_msg[0]} -m {commit_msg[1]} {dry_run_flag}",
error_msg="Failed to commit changes",
timeout_duration=10,
)
Expand Down
Loading
0