From 00688ac163bda310eb9d5c0fb6b8bcde0ccd7010 Mon Sep 17 00:00:00 2001 From: Michael Sena Date: Thu, 6 Feb 2014 12:32:56 +1100 Subject: [PATCH] Added a function to retrieve the current git branch. Allows git prompt info when using ZSH+oh-my-zsh through Cygwin. --- lib/git.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/git.zsh b/lib/git.zsh index 305a77aff..95152a5d8 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -7,6 +7,14 @@ function git_prompt_info() { fi } +git_prompt_info_quick() { + ref=$(git symbolic-ref HEAD) 2> /dev/null + if [ "${ref}" != "" ] + then + echo "git:${ref#refs/heads/}" + fi +} + # Checks if working tree is dirty parse_git_dirty() {