Simplify handling of empty diffs
This commit is contained in:
parent
26447c8205
commit
72766295c0
1 changed files with 1 additions and 4 deletions
|
|
@ -117,10 +117,6 @@ def main() -> None:
|
||||||
left_out = False
|
left_out = False
|
||||||
|
|
||||||
for section in sections:
|
for section in sections:
|
||||||
if not section["hunks"]:
|
|
||||||
left_out = True
|
|
||||||
continue
|
|
||||||
|
|
||||||
kept_hunks = []
|
kept_hunks = []
|
||||||
for hunk_lines in section["hunks"]:
|
for hunk_lines in section["hunks"]:
|
||||||
filtered = filter_hunk(hunk_lines, search, replace)
|
filtered = filter_hunk(hunk_lines, search, replace)
|
||||||
|
|
@ -132,6 +128,7 @@ def main() -> None:
|
||||||
left_out = True
|
left_out = True
|
||||||
|
|
||||||
if not kept_hunks:
|
if not kept_hunks:
|
||||||
|
left_out = True
|
||||||
continue
|
continue
|
||||||
|
|
||||||
output_lines.extend(section["header"])
|
output_lines.extend(section["header"])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue