Regression in git diff with stdin, with -R
- From
Martin Storsjö <martin@martin.st>
- Date
- Sep 9, 2023, 20:42 UTC
- Message-ID
- <d42579a0-f438-9b4c-97e4-58724dbe4a4@martin.st>
Hi,
Since 1e3f26542a6ecd3006c2c0d5ccc0bae4a700f7e5, "diff --no-index: support reading from named pipes", one usecase about diffing with stdin has broken.
I see that this patch was preceded by adding some extra tests around diffing with stdin - but one case seem to have been missed.
"git diff --no-index - regularfile" still works fine as it did before, also "git diff --no-index regularfile -" also still works. (I.e. stdin can either be the first or second file argument - both work.)
However if using the -R option to reverse the diff direction, i.e. "git diff --no-index -R - regularfile" or "git diff --no-index -R regularfile -", I'm now getting the following error:
fatal: stat '-': No such file or directory
// Martin