mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
Adopt subprocess.run(shell=True) for /git
This commit is contained in:
parent
44aa5c6d63
commit
5756812938
2 changed files with 7 additions and 4 deletions
|
@ -1,6 +1,5 @@
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
import shlex
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
@ -370,10 +369,15 @@ class Commands:
|
||||||
"Run a git command"
|
"Run a git command"
|
||||||
combined_output = None
|
combined_output = None
|
||||||
try:
|
try:
|
||||||
parsed_args = shlex.split("git " + args)
|
args = "git " + args
|
||||||
env = dict(GIT_EDITOR="true", **subprocess.os.environ)
|
env = dict(GIT_EDITOR="true", **subprocess.os.environ)
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
parsed_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, env=env
|
args,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.STDOUT,
|
||||||
|
text=True,
|
||||||
|
env=env,
|
||||||
|
shell=True,
|
||||||
)
|
)
|
||||||
combined_output = result.stdout
|
combined_output = result.stdout
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
@ -207,7 +207,6 @@ class GitRepo:
|
||||||
return fnames
|
return fnames
|
||||||
|
|
||||||
mtime = self.aider_ignore_file.stat().st_mtime
|
mtime = self.aider_ignore_file.stat().st_mtime
|
||||||
dump(mtime)
|
|
||||||
if mtime != self.aider_ignore_ts:
|
if mtime != self.aider_ignore_ts:
|
||||||
self.aider_ignore_ts = mtime
|
self.aider_ignore_ts = mtime
|
||||||
lines = self.aider_ignore_file.read_text().splitlines()
|
lines = self.aider_ignore_file.read_text().splitlines()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue