Skip to content

🐛 rename and copy operations produce empty output #1548

@ruro

Description

@ruro

Running this reproduction script:

#!/usr/bin/env bash

cd "$(mktemp -d)"

export GIT_CONFIG_GLOBAL=/dev/null
export GIT_CONFIG_NOSYSTEM=1
export PAGER=cat

git -c init.defaultBranch=master init . >/dev/null
git config user.email "testing@example.com"
git config user.name "Best Tester"

echo -e "something\nblah\nblah\nlong\nfile" > here
echo -e "different\nlorem\nipsum\ndolor\nsit\namet" > there
git add .
git commit -m "initial commit" >/dev/null

mv here moved
cp there copied
git add .
git commit -m "second commit" >/dev/null

echo "==== regular diff ===="
git --no-pager          diff -C -C HEAD~ HEAD
echo "======================"

echo

echo "==== $(delta --version | tr -d '\n') ===="
git -c core.pager=delta diff -C -C HEAD~ HEAD
echo "======================"

Produces the following output:

==== regular diff ====
diff --git a/there b/copied
similarity index 100%
copy from there
copy to copied
diff --git a/here b/moved
similarity index 100%
rename from here
rename to moved
======================

==== delta 0.16.5 ====
======================

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions