mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
Fix extracting file path from diff headers in udiff_coder.
This commit is contained in:
parent
4dee2ab2f4
commit
dc4bec2986
1 changed files with 1 additions and 3 deletions
|
@ -334,11 +334,9 @@ def process_fenced_block(lines, start_line_num):
|
|||
block = lines[start_line_num:line_num]
|
||||
block.append("@@ @@")
|
||||
|
||||
if block[1].startswith("--- ") and block[2].startswith("+++ "):
|
||||
if block[0].startswith("--- ") and block[1].startswith("+++ "):
|
||||
# Extract the file path, considering that it might contain spaces
|
||||
fname = block[1][4:].strip()
|
||||
# Ensure that the file path is the same for both the original and new file
|
||||
assert fname == block[2][4:].strip(), "File paths in diff headers do not match"
|
||||
block = block[2:]
|
||||
else:
|
||||
fname = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue