git:last-changed: Handle non-git-repo gracefully

This commit is contained in:
2023-01-17 01:44:01 +01:00
parent 99c99954e9
commit 4c489c0d68

View File

@@ -5,6 +5,12 @@
# sort the entries by the commits date and time to see the most recent changed
# files/folders at the bottom.
# Execute normal ls when not in git repo
if ! git rev-parse 2>/dev/null; then
ls -1p --color=auto "$@"
return
fi
local color_set
[ -t 1 ] && color_set=always || color_set=never