git:last-changed: Fix handling of weird filenames
Make sure that `git-log` does not misunderstand the file name.
This commit is contained in:
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user