From 57568129385912fa11e4a3762307bcbf388c663f Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 18 Oct 2023 12:37:39 -0700 Subject: [PATCH] Adopt subprocess.run(shell=True) for /git --- aider/commands.py | 10 +++++++--- aider/repo.py | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/aider/commands.py b/aider/commands.py index 99fddd527..63291a72d 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -1,6 +1,5 @@ import json import re -import shlex import subprocess import sys from pathlib import Path @@ -370,10 +369,15 @@ class Commands: "Run a git command" combined_output = None try: - parsed_args = shlex.split("git " + args) + args = "git " + args env = dict(GIT_EDITOR="true", **subprocess.os.environ) 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 except Exception as e: diff --git a/aider/repo.py b/aider/repo.py index 77df46988..866928235 100644 --- a/aider/repo.py +++ b/aider/repo.py @@ -207,7 +207,6 @@ class GitRepo: return fnames mtime = self.aider_ignore_file.stat().st_mtime - dump(mtime) if mtime != self.aider_ignore_ts: self.aider_ignore_ts = mtime lines = self.aider_ignore_file.read_text().splitlines()