Skip to content

Commit

Permalink
lib/git.zsh: Added git_commits_behind function (#4450)
Browse files Browse the repository at this point in the history
* Added git_commits_behind function
* Added 'command' to git_commits_behind function
* git_commits_behind code review changes
  • Loading branch information
stevenspasbo authored and mcornella committed Jul 15, 2016
1 parent 644bc64 commit 96a2092
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/git.zsh
Expand Up @@ -83,6 +83,13 @@ function git_commits_ahead() {
fi
}

# Gets the number of commits behind remote
function git_commits_behind() {
if $(command git rev-parse --git-dir > /dev/null 2>&1); then
echo $(git rev-list --count HEAD..@{upstream})
fi
}

# Outputs if current branch is ahead of remote
function git_prompt_ahead() {
if [[ -n "$(command git rev-list origin/$(git_current_branch)..HEAD 2> /dev/null)" ]]; then
Expand Down

0 comments on commit 96a2092

Please sign in to comment.