From cca7099db66e2daa21599d63586b4e3a46e4e6e2 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Thu, 16 Jun 2022 10:53:03 +0200 Subject: [PATCH] giti: No output if no git repository --- giti | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/giti b/giti index 2ad4d75..63ad831 100755 --- a/giti +++ b/giti @@ -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"