From 48944f214c7cd7402e70e661cf9efb8dd118fe0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sun, 10 Sep 2023 00:12:52 +0200 Subject: diff --no-index: fix -R with stdin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When -R is given, queue_diff() swaps the mode and name variables of the two files to produce a reverse diff. 1e3f26542a (diff --no-index: support reading from named pipes, 2023-07-05) added variables that indicate whether files are special, i.e named pipes or - for stdin. These new variables were not swapped, though, which broke the handling of stdin with with -R. Swap them like the other metadata variables. Reported-by: Martin Storsjö Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- diff-no-index.c | 1 + 1 file changed, 1 insertion(+) (limited to 'diff-no-index.c') diff --git a/diff-no-index.c b/diff-no-index.c index 4771cf02aa..3e573505e0 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -232,6 +232,7 @@ static int queue_diff(struct diff_options *o, if (o->flags.reverse_diff) { SWAP(mode1, mode2); SWAP(name1, name2); + SWAP(special1, special2); } d1 = noindex_filespec(name1, mode1, special1); -- cgit v1.2.3