Browse Source

giti: No output if no git repository

84582af
Dirk Alders 2 years ago
parent
commit
cca7099db6
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      giti

+ 4
- 0
giti View File

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

Loading…
Cancel
Save