Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2023-09-10 01:12:52 +0300
committerJunio C Hamano <gitster@pobox.com>2023-09-11 22:05:37 +0300
commit48944f214c7cd7402e70e661cf9efb8dd118fe0c (patch)
treea47c663635631abe4feefc510745308448a272a6 /diff-no-index.c
parente5cb1e3f093986815945b85e61de112b8e3ccdd6 (diff)
diff --no-index: fix -R with stdin
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ö <martin@martin.st> Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-no-index.c')
-rw-r--r--diff-no-index.c1
1 files changed, 1 insertions, 0 deletions
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);