mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-05 21:30:40 +08:00
Add handling for empty diffs in Bitbucket provider to avoid logging errors
This commit is contained in:
@ -171,6 +171,9 @@ class BitbucketProvider(GitProvider):
|
|||||||
diff_split_lines[4].startswith("+++") and
|
diff_split_lines[4].startswith("+++") and
|
||||||
diff_split_lines[5].startswith("@@"))):
|
diff_split_lines[5].startswith("@@"))):
|
||||||
diff_split[i] = "\n".join(diff_split_lines[4:])
|
diff_split[i] = "\n".join(diff_split_lines[4:])
|
||||||
|
else:
|
||||||
|
if diffs[i].data.get('lines_added', 0) == 0 and diffs[i].data.get('lines_removed', 0) == 0:
|
||||||
|
diff_split[i] = ""
|
||||||
else:
|
else:
|
||||||
get_logger().error(f"Error - failed to remove the bitbucket header from diff {i}")
|
get_logger().error(f"Error - failed to remove the bitbucket header from diff {i}")
|
||||||
break
|
break
|
||||||
|
Reference in New Issue
Block a user