Skip to content

Commit 0aefade

Browse files
PDP-919: Ignore whitespaces (#33)
1 parent 682300a commit 0aefade

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

github-app/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,10 @@ def download_files(self, file_paths):
316316
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)
317317
if clone_res.returncode != 0:
318318
raise Exception(f"Git clone failed: {clone_res.stderr}")
319-
# First try normal apply for new files, then 3way for modifications
320-
normal_apply_res = subprocess.run(['git','apply','--ignore-whitespace', diff_path], cwd=base_clone_dir, capture_output=True, text=True, timeout=30)
319+
# First try apply with whitespace fix, then 3way for modifications
320+
normal_apply_res = subprocess.run(['git','apply','--whitespace=fix', diff_path], cwd=base_clone_dir, capture_output=True, text=True, timeout=30)
321321
if normal_apply_res.returncode != 0:
322-
logger.info(f"Normal git apply failed, trying --3way: {normal_apply_res.stderr[:200]}")
322+
logger.info(f"Git apply failed, trying --3way: {normal_apply_res.stderr[:200]}")
323323
threeway_apply_res = subprocess.run(['git','apply','--3way','--ignore-whitespace', diff_path], cwd=base_clone_dir, capture_output=True, text=True, timeout=30)
324324
apply_res = threeway_apply_res
325325
else:

0 commit comments

Comments
 (0)