From 5432469ef6377f8100f8e7ba03a9312ee780fa5c Mon Sep 17 00:00:00 2001 From: mrT23 Date: Sun, 1 Sep 2024 08:39:29 +0300 Subject: [PATCH] fix: ensure non-empty lines are processed correctly in git patch handling --- pr_agent/algo/git_patch_processing.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pr_agent/algo/git_patch_processing.py b/pr_agent/algo/git_patch_processing.py index 0d85a4d3..18c617fc 100644 --- a/pr_agent/algo/git_patch_processing.py +++ b/pr_agent/algo/git_patch_processing.py @@ -164,9 +164,10 @@ def omit_deletion_hunks(patch_lines) -> str: inside_hunk = True else: temp_hunk.append(line) - edit_type = line[0] - if edit_type == '+': - add_hunk = True + if line: + edit_type = line[0] + if edit_type == '+': + add_hunk = True if inside_hunk and add_hunk: added_patched.extend(temp_hunk)