From 8217193b73a32398a7538b9c0bb004ff23ea2222 Mon Sep 17 00:00:00 2001 From: Philip Hofstetter Date: Wed, 28 Dec 2011 15:02:11 +0100 Subject: [PATCH] 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 --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index defa062c6..805345663 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -15,7 +15,7 @@ parse_git_dirty() { # 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 $(echo "$(git log $(git_current_upstream)/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then echo "$ZSH_THEME_GIT_PROMPT_AHEAD" fi }