summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToon Claes <toine@iMacT.local>2009-11-26 21:13:56 +0100
committerToon Claes <toine@iMacT.local>2009-11-26 21:13:56 +0100
commit328e67eb00c13e8e1046fde576af390fa61fcac2 (patch)
treee4e442e0a14fc3f9fba58ad84ec31bebd399a9c2
parent3f49658cb53c589808e7fac47f4a6837c503292d (diff)
parent473dd3b2121ae0e54803098a7fde4b4c1e673145 (diff)
downloadzsh-328e67eb00c13e8e1046fde576af390fa61fcac2.tar.gz
zsh-328e67eb00c13e8e1046fde576af390fa61fcac2.tar.bz2
zsh-328e67eb00c13e8e1046fde576af390fa61fcac2.zip
Merge branch 'master' of git://github.com/robbyrussell/oh-my-zsh
-rw-r--r--lib/git.zsh8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/git.zsh b/lib/git.zsh
index 58d826d0c..52c7969f3 100644
--- a/lib/git.zsh
+++ b/lib/git.zsh
@@ -12,3 +12,11 @@ parse_git_dirty () {
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/}
+}