From 92ae9f6d6b2239c570e16b97e58f60dcdeab65c4 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Fri, 5 Feb 2010 02:48:22 +0100 Subject: [PATCH] fix branch detection in fake bare git repos --- .zsh/zshrc/60_vcsprompt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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/}" } -- 2.39.5