fix(zsh): Don't detect empty untracked dir

This commit is contained in:
Ahmad Ansori Palembani 2024-07-15 08:35:22 +07:00
parent 2ff100e3bf
commit 93b32a8f43
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6

View file

@ -18,7 +18,7 @@ zstyle ':vcs_info:*' enable git
# git untracked
if [ $(git rev-parse --is-inside-work-tree 2> /dev/null) = 'true' ] && \
[ $(git ls-files --other --directory --exclude-standard | sed q | wc -l | tr -d ' ') = 1 ] ; then
[ $(git ls-files --other --directory --exclude-standard --no-empty-directory | sed q | wc -l | tr -d ' ') = 1 ] ; then
hook_com[unstaged]+='%F{1}?%f'
fi
}