From 72766295c03396a06befbcc5106d0cfbb4b925bc Mon Sep 17 00:00:00 2001 From: Sven van Heugten Date: Thu, 5 Mar 2026 20:58:51 +0100 Subject: [PATCH] Simplify handling of empty diffs --- bin/mechanicaldiff.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bin/mechanicaldiff.py b/bin/mechanicaldiff.py index 57c5cbf..11fc6c5 100755 --- a/bin/mechanicaldiff.py +++ b/bin/mechanicaldiff.py @@ -117,10 +117,6 @@ def main() -> None: left_out = False for section in sections: - if not section["hunks"]: - left_out = True - continue - kept_hunks = [] for hunk_lines in section["hunks"]: filtered = filter_hunk(hunk_lines, search, replace) @@ -132,6 +128,7 @@ def main() -> None: left_out = True if not kept_hunks: + left_out = True continue output_lines.extend(section["header"])