From: martin f. krafft Date: Fri, 5 Feb 2010 01:48:22 +0000 (+0100) Subject: fix branch detection in fake bare git repos X-Git-Url: https://git.madduck.net/etc/zsh.git/commitdiff_plain/92ae9f6d6b2239c570e16b97e58f60dcdeab65c4?ds=sidebyside;hp=-c fix branch detection in fake bare git repos --- 92ae9f6d6b2239c570e16b97e58f60dcdeab65c4 diff --git a/.zsh/zshrc/60_vcsprompt b/.zsh/zshrc/60_vcsprompt index d12f686..dd8335a 100644 --- a/.zsh/zshrc/60_vcsprompt +++ b/.zsh/zshrc/60_vcsprompt @@ -27,8 +27,8 @@ __git_get_branch() { # return the name of the git branch we're on local ref - ref=$(git symbolic-ref -q HEAD 2>/dev/null \ - || git-name-rev --name-only HEAD 2>/dev/null) || return 1 + ref=$(git --git-dir="$PWD" symbolic-ref -q HEAD 2>/dev/null \ + || git --git-dir="$PWD" name-rev --name-only HEAD 2>/dev/null) || return 1 echo "${ref#refs/heads/}" }