From 80515b69c1ab3aaa943fe77a9eaf047bc1587997 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sun, 20 Apr 2025 17:34:36 -0700 Subject: [PATCH] fix: Strip b/ prefix when a path is /dev/null in diffs --- aider/coders/udiff_coder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aider/coders/udiff_coder.py b/aider/coders/udiff_coder.py index 7c276408b..fff6971b7 100644 --- a/aider/coders/udiff_coder.py +++ b/aider/coders/udiff_coder.py @@ -348,8 +348,8 @@ def process_fenced_block(lines, start_line_num): a_fname = block[0][4:].strip() b_fname = block[1][4:].strip() - # Check if standard git diff prefixes are present and strip them - if a_fname.startswith("a/") and b_fname.startswith("b/"): + # Check if standard git diff prefixes are present (or /dev/null) and strip them + if (a_fname.startswith("a/") or a_fname == "/dev/null") and b_fname.startswith("b/"): fname = b_fname[2:] else: # Otherwise, assume the path is as intended