Hide errors if git status fails

This commit is contained in:
ItsDrike 2021-12-15 22:08:01 +01:00
parent 177a33cc69
commit 39a66f0e30
No known key found for this signature in database
GPG key ID: FB8CA11A2CF3A843

View file

@ -52,7 +52,7 @@ git_prompt() {
ref=$(command git symbolic-ref HEAD 2> /dev/null) || ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0
echo -n " $ORANGE${ref#refs/heads/}"
if [ ! -z "$(git status --short)" ]; then
if [ ! -z "$(git status --short 2>/dev/null)" ]; then
echo "$RED+"
fi
}