From: Junio C Hamano Date: Mon, 21 Sep 2026 18:01:18 GMT Subject: Re: [PATCH] diff --no-index: fix -R with file/directory conflicts Message-ID: In-Reply-To: <0c82d50e-f2c0-4db6-ade8-7a403cac73da@intel.com> Jacob Keller writes: > On 9/18/2026 12:19 AM, Haokai Ding via GitGitGadget wrote: >> From: Haokai Ding >> >> When a path is a file on one side and a directory on the other, >> queue_diff() queues the file separately before recursing into the >> directory. This early queue entry bypasses the reverse_diff handling >> used for ordinary files. >> >> As a result, comparing directories d and e where d/sub is a file and >> e/sub/file is another file reports both paths as deleted with -R. >> Reversing the operands reports both paths as added instead. >> >> Swap the filespecs of the early queue entry when reverse_diff is set, >> so that -R reverses the file change as well as the directory contents. >> Add regression tests for both directions. >> >> Signed-off-by: Haokai Ding >> --- > > Thanks for fixing! > > Reviewed-by: Jacob Keller Thanks, both. Will queue.