Browse Source

fix(lib): fix status exit code check in `git_prompt_status` (#10275)

Pooya Vahidi 2 years ago
parent
commit
07cdd7a539
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lib/git.zsh

+ 2 - 1
lib/git.zsh

@@ -206,7 +206,8 @@ function git_prompt_status() {
     STASHED UNMERGED AHEAD BEHIND DIVERGED
   )
 
-  local status_text="$(__git_prompt_git status --porcelain -b 2> /dev/null)"
+  local status_text
+  status_text="$(__git_prompt_git status --porcelain -b 2> /dev/null)"
 
   # Don't continue on a catastrophic failure
   if [[ $? -eq 128 ]]; then