diff --git a/lib/git.zsh b/lib/git.zsh index 148695643..444b30f3d 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -57,7 +57,7 @@ git_remote_status() { # Checks if there are commits ahead from remote function git_prompt_ahead() { - if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then + if [[ -n $(git rev-list -1 origin/$(current_branch)..HEAD 2>/dev/null) ]]; then echo "$ZSH_THEME_GIT_PROMPT_AHEAD" fi }