diff --git a/github-app/app.py b/github-app/app.py index 08de1e5..55f9273 100644 --- a/github-app/app.py +++ b/github-app/app.py @@ -316,10 +316,10 @@ def download_files(self, file_paths): clone_res = subprocess.run(['git','clone','--depth','1','--branch', self.pr_data['base']['ref'], auth_clone_url, base_clone_dir], capture_output=True, text=True, timeout=60) if clone_res.returncode != 0: raise Exception(f"Git clone failed: {clone_res.stderr}") - # First try normal apply for new files, then 3way for modifications - normal_apply_res = subprocess.run(['git','apply','--ignore-whitespace', diff_path], cwd=base_clone_dir, capture_output=True, text=True, timeout=30) + # First try apply with whitespace fix, then 3way for modifications + normal_apply_res = subprocess.run(['git','apply','--whitespace=fix', diff_path], cwd=base_clone_dir, capture_output=True, text=True, timeout=30) if normal_apply_res.returncode != 0: - logger.info(f"Normal git apply failed, trying --3way: {normal_apply_res.stderr[:200]}") + logger.info(f"Git apply failed, trying --3way: {normal_apply_res.stderr[:200]}") threeway_apply_res = subprocess.run(['git','apply','--3way','--ignore-whitespace', diff_path], cwd=base_clone_dir, capture_output=True, text=True, timeout=30) apply_res = threeway_apply_res else: