(self, cmd)
| 69 | return changed_files |
| 70 | |
| 71 | def execute(self, cmd) -> str: |
| 72 | logging.debug(cmd) |
| 73 | try: |
| 74 | res = subprocess.run( |
| 75 | cmd, |
| 76 | cwd=self.root_dir, |
| 77 | check=True, |
| 78 | capture_output=True, |
| 79 | text=True, |
| 80 | ) |
| 81 | except subprocess.CalledProcessError as e: |
| 82 | logging.error(f"cmd: {' '.join(cmd)}") |
| 83 | logging.error(f"out: {e.stdout}") |
| 84 | logging.error(f"err: {e.stderr}") |
| 85 | raise RuntimeError("Git command failed") |
| 86 | return res.stdout |