This commit is contained in:
Bryan Jowers 2012-09-25 19:18:00 -05:00
parent 6230eeec4a
commit 1b4c0b59b4

View file

@ -143,19 +143,19 @@ function updateprompt () {
if [[ -n ${remote} ]] ; then if [[ -n ${remote} ]] ; then
# for git prior to 1.7 # for git prior to 1.7
# ahead=$(git rev-list origin/${hook_com[branch]}..HEAD | wc -l) # ahead=$(git rev-list origin/${hook_com[branch]}..HEAD | wc -l)
local ahead="$(git rev-list ${branch}@{upstream}..HEAD 2>/dev/null | wc -l)" local ahead="$(git rev-list ${branch}@{upstream}..HEAD 2>/dev/null | wc -l | xargs)"
gitstatus+=( "${GREEN}+${ahead}${GRAY}" ) gitstatus+=( "${GREEN}+${ahead}${GRAY}" )
# for git prior to 1.7 # for git prior to 1.7
# behind=$(git rev-list HEAD..origin/${hook_com[branch]} | wc -l) # behind=$(git rev-list HEAD..origin/${hook_com[branch]} | wc -l)
local behind="$(git rev-list HEAD..${branch}@{upstream} 2>/dev/null | wc -l)" local behind="$(git rev-list HEAD..${branch}@{upstream} 2>/dev/null | wc -l | xargs)"
gitstatus+=( "${RED}-${behind}${GRAY}" ) gitstatus+=( "${RED}-${behind}${GRAY}" )
remotepart="${RESETCOLOR}${GRAY}[${remote} ${(j:/:)gitstatus}]${RESETCOLOR}" remotepart="${RESETCOLOR}${GRAY}[${remote} ${(j:/:)gitstatus}]${RESETCOLOR}"
fi fi
local stashpart="" local stashpart=""
if [[ -s ${gitdir}/refs/stash ]] ; then if [[ -s ${gitdir}/refs/stash ]] ; then
stashes=$(git stash list 2>/dev/null | wc -l) stashes="$(git stash list 2>/dev/null | wc -l | xargs)"
stashpart="${RESETCOLOR}${GRAY}(${GREEN}${stashes}${GRAY} stashed)${RESETCOLOR}" stashpart="${RESETCOLOR}${GRAY}(${GREEN}${stashes}${GRAY} stashed)${RESETCOLOR}"
fi fi
local stats="$(git_prompt_status)" local stats="$(git_prompt_status)"