giti: No output if no git repository

This commit is contained in:
Dirk Alders 2022-06-16 10:53:03 +02:00
parent 9f0c412449
commit cca7099db6

4
giti
View File

@ -30,6 +30,10 @@ else
git_status="$(LANGUAGE='en_US.UTF-8 git' git status 2> /dev/null)"
git_diff="$(git status --porcelain 2> /dev/null)"
#
if [ -z "$git_status" ]; then
# No GIT repository
exit
fi
if [[ $SHORT ]]; then
if [[ ! $git_status =~ "working tree clean" ]] && [[ ! $git_status =~ "working directory clean" ]]; then
git_status_color="$COLOR_RED"