Browse Source

Merge branch 'master' of git://github.com/robbyrussell/oh-my-zsh

Toon Claes 15 years ago
parent
commit
328e67eb00
1 changed files with 8 additions and 0 deletions
  1. 8 0
      lib/git.zsh

+ 8 - 0
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/}
+}