git:last-changed: Fix handling of weird filenames

Make sure that `git-log` does not misunderstand the file name.
This commit is contained in:
2023-02-13 17:12:44 +01:00
parent 0a749cd6f5
commit 0625fdbd94

View File

@@ -17,7 +17,7 @@ local color_set
ls -1p --color="$color_set" "$@" \
| while read -r line; do
sanitized_line="$(sed 's/\x1b\[[^m]*m//g' <<<"$line")"
git_info="$(git log -1 --format=$'%ci\t%s' "$sanitized_line")"
git_info="$(git log -1 --format=$'%ci\t%s' -- "$sanitized_line")"
printf "%s\t%s\n" "$line" "$git_info"
done \
| sort -r -t$'\t' -k2,2 \