giti: No output if no git repository
This commit is contained in:
parent
9f0c412449
commit
cca7099db6
4
giti
4
giti
@ -30,6 +30,10 @@ else
|
|||||||
git_status="$(LANGUAGE='en_US.UTF-8 git' git status 2> /dev/null)"
|
git_status="$(LANGUAGE='en_US.UTF-8 git' git status 2> /dev/null)"
|
||||||
git_diff="$(git status --porcelain 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 [[ $SHORT ]]; then
|
||||||
if [[ ! $git_status =~ "working tree clean" ]] && [[ ! $git_status =~ "working directory clean" ]]; then
|
if [[ ! $git_status =~ "working tree clean" ]] && [[ ! $git_status =~ "working directory clean" ]]; then
|
||||||
git_status_color="$COLOR_RED"
|
git_status_color="$COLOR_RED"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user