diff --git a/git.py b/git.py index b5fcda47..c8956916 100644 --- a/git.py +++ b/git.py @@ -11,6 +11,16 @@ from datetime import datetime def run_command(cmd, cwd=None): """Run a shell command and return output.""" + # On Windows, if cmd starts with 'git', we need to use the full path to avoid conflict with git.py + if sys.platform == "win32" and cmd.strip().startswith("git "): + # Use full path to git.exe with proper quoting + git_exe = r'"C:\Program Files\Git\bin\git.exe"' + if os.path.exists(git_exe.strip('"')): + # Replace 'git' with the full path + parts = cmd.split(" ", 1) + if parts[0] == "git": + cmd = f'{git_exe} {parts[1]}' if len(parts) > 1 else git_exe + try: result = subprocess.run(cmd, shell=True, capture_output=True, text=True, cwd=cwd) return result.returncode, result.stdout, result.stderr diff --git a/test_fixed_git.txt b/test_fixed_git.txt new file mode 100644 index 00000000..68def2c9 Binary files /dev/null and b/test_fixed_git.txt differ