fix patch suffix error

This commit is contained in:
shenchucheng 2024-08-20 20:25:45 +08:00
parent 13f0e6b3dd
commit b09617b9df

View file

@ -88,7 +88,7 @@ class CodeReview:
async with aiofiles.open(patch_path, encoding="utf-8") as f:
patch_file_content = await f.read()
await EditorReporter().async_report(patch_path)
if not patch_path.endswith((".diff", "patch")):
if not patch_path.endswith((".diff", ".patch")):
name = Path(patch_path).name
patch_file_content = "".join(
difflib.unified_diff([], patch_file_content.splitlines(keepends=True), "/dev/null", f"b/{name}"),