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

πŸ› Duplicated lines when Git detects rename out of Git repo #366

Open
FranklinYu opened this issue Oct 26, 2020 · 1 comment
Open

Comments

@FranklinYu
Copy link

Delta:

renamed: /tmp/delta-example/dir-1/diagnostics ⟢   /tmp/delta-example/dir-2/diagnostics-2
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

renamed: tmp/delta-example/dir-1/diagnostics ⟢   tmp/delta-example/dir-2/diagnostics-2
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

────────────────────────────────┐
for cmd in "${commands[@]}"; do β”‚
β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
17
    eval "$cmd"
    echo
done

echo 'Hello!'

raw:

diff --git a/tmp/delta-example/dir-1/diagnostics b/tmp/delta-example/dir-2/diagnostics-2
similarity index 96%
rename from /tmp/delta-example/dir-1/diagnostics
rename to /tmp/delta-example/dir-2/diagnostics-2
index 0b4d47c..7c07815 100755
--- a/tmp/delta-example/dir-1/diagnostics
+++ b/tmp/delta-example/dir-2/diagnostics-2
@@ -17,3 +17,5 @@ for cmd in "${commands[@]}"; do
     eval "$cmd"
     echo
 done
+
+echo 'Hello!'

This doesn’t seem like a regression of #102 or #245; the original bug is only for Git repository, while this is comparing two non-Git directories like this:

git diff /tmp/delta-example/dir-1 /tmp/delta-example/dir-2

I noticed that it can only be reproduced when absolute paths are used, not

git diff dir-1 dir-2
@dandavison
Copy link
Owner

Thanks @FranklinYu! Indeed, this reproduces on passing your diff to delta on stdin.

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