Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions github-app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down