don't assume "origin" in git_prompt_ahead()

it's possible that you are working on a tracking branch that tracks
something else than origin.

This uses the new git_current_upstream() function to determine the
remote of the branch that is currently being tracked
This commit is contained in:
Philip Hofstetter 2011-12-28 15:02:11 +01:00
commit 8217193b73

View file

@ -15,7 +15,7 @@ parse_git_dirty() {
# Checks if there are commits ahead from remote # Checks if there are commits ahead from remote
function git_prompt_ahead() { function git_prompt_ahead() {
if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then if $(echo "$(git log $(git_current_upstream)/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
echo "$ZSH_THEME_GIT_PROMPT_AHEAD" echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
fi fi
} }