Bug report: Same path printed twice when comparing two directories outside repo

From: Lexis <hidden>
Date: 2020-08-15 23:29:35
Subsystem: the rest · Maintainer: Linus Torvalds

# Bug report: Same path printed twice when comparing two directories
outside repo

## Repro steps
#!/bin/bash
cd $(mktemp -d)
mkdir dir0
mkdir dir1
touch dir1/test
git diff --no-index dir0 dir1
## Expected output
diff --git a/dir0/test b/dir1/test

new file mode 100644

index 0000000..e69de29

## Actual output
diff --git a/dir1/test b/dir1/test

new file mode 100644

index 0000000..e69de29

## Difference between expected and actual output

The first output line shows the path to the compared file in the second
directory twice in the actual output. I expected it to print one path
for each directory.

[System Info]
git Version:
git version 2.28.0.297.g1956fa8f8d
cpu: x86_64
built from commit: 1956fa8f8d7168157346f0cbc0f1f9dd1fca787a
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 5.7.14-200.fc32.x86_64 #1 SMP Fri Aug 7 23:16:37 UTC 2020
x86_64
Compiler Info: gnuc: 10.2
libc Info: glibc: 2.31
$SHELL (typically, interactive shell): /usr/bin/zsh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help