e129fc5a285ccc8ff3c6ae9770908a0b5c2836e7

Author
Juan G. Hurtado <juan.g.hurtado@gmail.com>
Committer
Juan G. Hurtado <juan.g.hurtado@gmail.com>
Date

Message

Adds support for $(current_branch) on git_parse_ahead()

Changes method git_parse_ahead() on git.zsh lib file. Before this
change it checked directly against origin/master branch. Now it
uses $(current_branch) to check for not pushed changes against
the current remote branch.

Diff

 1diff --git a/lib/git.zsh b/lib/git.zsh
 2index e96f075beeb7efcfc23c6b7520bf7bc46e1e9430..2ace3d0e0ff7fab9514dda73d24f4f9c83aed2cd 100644
 3--- a/lib/git.zsh
 4+++ b/lib/git.zsh
 5@@ -15,7 +15,7 @@ parse_git_dirty() {
 6 
 7 # Checks if there are commits ahead from remote
 8 function git_prompt_ahead() {
 9-  if $(echo "$(git log origin/master..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
10+  if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
11     echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
12   fi
13 }