diff --git a/prompt.zsh b/prompt.zsh index 4107c95..dcb4356 100644 --- a/prompt.zsh +++ b/prompt.zsh @@ -34,8 +34,10 @@ zstyle ':vcs_info:git*' actionformats ' %b|%a' # Fastest possible way to check if repo is dirty git_dirty() { - [ -d .git ] || return - command git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo '*' + # check if we're in a git repo + command git rev-parse --is-inside-work-tree &>/dev/null || return + # check if it's dirty + command git diff --quiet --ignore-submodules HEAD &>/dev/null; [ $? -eq 1 ] && echo '*' } # Displays the exec time of the last command if set threshold was exceeded