The output of git diff --name-only is not very useful for file names that are not ASCII. Example:
git init
echo Germany > Düsseldorf.txt
echo Mexico > Cancún.txt
git add *.txt
while read f
do cat "$f"
done < <(git diff --cached --name-only)
This results in the following output:
cat: '"Canc303272n.txt"': No such file or directory
cat: '"D303274sseldorf.txt"': No such file or directory
How can I obtain a listing of the staged files that's useful for further processing?