diff --git a/lib/git.zsh b/lib/git.zsh index 8237af751..45148cc2f 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -195,6 +195,14 @@ function git_commits_behind() { fi } +function git_commits_status() { + local ahead=$(git_commits_ahead) + local behind=$(git_commits_behind) + if [[ -n "$ahead$behind" ]]; then + echo "$ZSH_THEME_GIT_COMMITS_STATUS_PREFIX$ahead$behind$ZSH_THEME_GIT_COMMITS_STATUS_SUFFIX" + fi +} + # Outputs if current branch is ahead of remote function git_prompt_ahead() { if [[ -n "$(__git_prompt_git rev-list origin/$(git_current_branch)..HEAD 2> /dev/null)" ]]; then