27904c117c3ee70938edbac45cee7a44ced5c38b

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Moving current_branch() to git plugin

Diff

 1diff --git a/lib/git.zsh b/lib/git.zsh
 2index a54e5bcbbf58a8bb6e4f1a7f2b67bfcb98dd4c3e..889dd98dff0f76d07c2ccd7adcbec5bf66c66cff 100644
 3--- a/lib/git.zsh
 4+++ b/lib/git.zsh
 5@@ -11,12 +11,3 @@ parse_git_dirty () {
 6     echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
 7   fi
 8 }
 9-
10-#
11-# Will return the current branch name
12-# Usage example: git pull origin $(current_branch)
13-#
14-function current_branch() {
15-  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
16-  echo ${ref#refs/heads/}
17-}
18diff --git a/plugins/git.plugin.zsh b/plugins/git.plugin.zsh
19index 26777a62a2ba29de739cdf5e00a4227a4bbd84ce..e0d96705640d4a4ffbddf0a13e12996175cdd61f 100644
20--- a/plugins/git.plugin.zsh
21+++ b/plugins/git.plugin.zsh
22@@ -17,5 +17,15 @@ alias gcp='git cherry-pick'
23 # Git and svn mix
24 alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
25 
26+#
27+# Will return the current branch name
28+# Usage example: git pull origin $(current_branch)
29+#
30+function current_branch() {
31+  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
32+  echo ${ref#refs/heads/}
33+}
34+
35+# these aliases take advangate of the previous function
36 alias ggpull='git pull origin $(current_branch)'
37 alias ggpush='git push origin $(current_branch)'