mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 01:04:59 +00:00
fixed corner case bugs in find_original_update_blocks
This commit is contained in:
parent
87c902b285
commit
445c253abc
1 changed files with 10 additions and 6 deletions
|
@ -234,7 +234,9 @@ def find_original_update_blocks(content):
|
|||
if not len(filename) or "`" in filename:
|
||||
filename = processed[-2].splitlines()[-2].strip()
|
||||
if not len(filename) or "`" in filename:
|
||||
raise ValueError(f"Bad/missing filename. It should go right above {ORIGINAL}")
|
||||
raise ValueError(
|
||||
f"Bad/missing filename. It should go right above {ORIGINAL}"
|
||||
)
|
||||
except IndexError:
|
||||
raise ValueError(f"Bad/missing filename. It should go right above {ORIGINAL}")
|
||||
|
||||
|
@ -247,8 +249,10 @@ def find_original_update_blocks(content):
|
|||
raise ValueError(f"Expected {DIVIDER}")
|
||||
|
||||
updated_text = pieces.pop()
|
||||
processed.append(updated_text)
|
||||
|
||||
updated_marker = pieces.pop()
|
||||
processed.append(updated_marker)
|
||||
if updated_marker.strip() != UPDATED:
|
||||
raise ValueError(f"Expected {UPDATED}")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue