Add two files (one text, one binary) in the root of a git repo (/d/temp) to git cache, create a subdirectory, cd there and do a git diff --cached, you will get this output:
$ pwd
/d/temp/subdir
$ git diff --cached
added: README.md
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─────┐
• 1: │
─────┘
Hello World
added: image.png (binary file)
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Now set git config delta.relative-paths true and you will get this output:
$ git diff --cached
Δ \dev\null ⟶ ..\README.md
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─────┐
• 1: │
─────┘
Hello World
added: image.png (binary file)
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Directory structure
./image.png
./README.md
./subdir <-- cwd
\dev\null gets inserted because of #1538
..\README.md is correct
image.png is wrong, should be ..\image.png - delta uses absolute path here, but should use relative path!
Delta version 0.17.0, can reproduce on Windows 11 and Linux
Add two files (one text, one binary) in the root of a git repo (
/d/temp) to git cache, create a subdirectory,cdthere and do agit diff --cached, you will get this output:Now set
git config delta.relative-paths trueand you will get this output:Directory structure
\dev\nullgets inserted because of #1538..\README.mdis correctimage.pngis wrong, should be..\image.png- delta uses absolute path here, but should use relative path!Delta version
0.17.0, can reproduce on Windows 11 and Linux