Add error handling for empty diff files in utils.py and optimize file content retrieval in Bitbucket provider

This commit is contained in:
mrT23
2024-08-13 22:33:07 +03:00
parent a3b3d6c77a
commit 86a9cfedc8
2 changed files with 19 additions and 6 deletions

View File

@ -781,6 +781,9 @@ def find_line_number_of_relevant_line_in_file(diff_files: List[FilePatchInfo],
re_hunk_header = re.compile(
r"^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@[ ]?(.*)")
if not diff_files:
return position, absolute_position
for file in diff_files:
if file.filename and (file.filename.strip() == relevant_file):
patch = file.patch