Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 relative-paths option doesn't work for binary files #1738

Closed
stefan-muc opened this issue Jul 5, 2024 · 1 comment
Closed

🐛 relative-paths option doesn't work for binary files #1738

stefan-muc opened this issue Jul 5, 2024 · 1 comment

Comments

@stefan-muc
Copy link

stefan-muc commented Jul 5, 2024

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

@th1000s
Copy link
Collaborator

th1000s commented Jul 6, 2024

Indeed, the paths were not updated in case of binary files. Fixed in #1740

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants