From 27904c117c3ee70938edbac45cee7a44ced5c38b Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Thu, 3 Jun 2010 12:56:11 -0700 Subject: [PATCH] Moving current_branch() to git plugin --- lib/git.zsh | 9 --------- plugins/git.plugin.zsh | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index a54e5bcbb..889dd98df 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -11,12 +11,3 @@ parse_git_dirty () { echo "$ZSH_THEME_GIT_PROMPT_CLEAN" fi } - -# -# Will return the current branch name -# Usage example: git pull origin $(current_branch) -# -function current_branch() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return - echo ${ref#refs/heads/} -} diff --git a/plugins/git.plugin.zsh b/plugins/git.plugin.zsh index 26777a62a..e0d967056 100644 --- a/plugins/git.plugin.zsh +++ b/plugins/git.plugin.zsh @@ -17,5 +17,15 @@ alias gcp='git cherry-pick' # Git and svn mix alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' +# +# Will return the current branch name +# Usage example: git pull origin $(current_branch) +# +function current_branch() { + ref=$(git symbolic-ref HEAD 2> /dev/null) || return + echo ${ref#refs/heads/} +} + +# these aliases take advangate of the previous function alias ggpull='git pull origin $(current_branch)' alias ggpush='git push origin $(current_branch)'