From 6c9fa1a13c3c64577c8909704f6d7b9090215178 Mon Sep 17 00:00:00 2001 From: Andrew Hodges Date: Sun, 29 May 2011 16:12:14 -0400 Subject: [PATCH] Succumbed to Peer Pressure Change git_current_branch to current_branch. --- lib/git.zsh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index 4697a0f1a..a5a7d2e84 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -15,13 +15,13 @@ function parse_git_dirty() { # Checks if there are commits ahead from remote function git_prompt_ahead() { - if $(echo "$(git log $(git_current_remote)/$(git_current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then + if $(echo "$(git log $(git_current_remote)/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then echo "$ZSH_THEME_GIT_PROMPT_AHEAD" fi } function git_prompt_behind() { - if $(echo "$(git log HEAD..$(git_current_remote)/$(git_current_branch) 2> /dev/null)" | grep '^commit' &> /dev/null); then + if $(echo "$(git log HEAD..$(git_current_remote)/$(current_branch) 2> /dev/null)" | grep '^commit' &> /dev/null); then echo "$ZSH_THEME_GIT_PROMPT_BEHIND" fi } @@ -67,13 +67,8 @@ function git_prompt_status() { echo $STATUS } -function git_current_branch() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return - echo ${ref#refs/heads/} -} - function git_current_remote() { - remote=$(git config --get "branch.$(git_current_branch).remote") + remote=$(git config --get "branch.$(current_branch).remote") if [ -z "$remote" ]; then echo 'origin' else