From d2bac0c8047d0a79b7d8c23c2b7324592d89e41d Mon Sep 17 00:00:00 2001 From: Colin Hebert Date: Tue, 27 Mar 2012 11:21:15 +0100 Subject: [PATCH] Use git rev-parse --git-dir to get the git directory --- plugins/git/functions/git-info | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/plugins/git/functions/git-info b/plugins/git/functions/git-info index 7efc2ea7..a561c5ec 100644 --- a/plugins/git/functions/git-info +++ b/plugins/git/functions/git-info @@ -7,21 +7,10 @@ # Gets the path to the Git directory. function _git-dir { - local git_root="$(git-root)" - local git_dir_or_file="${git_root}/.git" local git_dir + git_dir=("$(git rev-parse --git-dir)"(:A)) - if [[ ! -d "$git_root" ]]; then - return 1 - fi - - if [[ -f "$git_dir_or_file" ]]; then - git_dir="${${${$(<"$git_dir_or_file")}[(fr)gitdir:*]}#gitdir: }" - else - git_dir="$git_dir_or_file" - fi - - if [[ -d "$git_dir" ]]; then + if [[ -n "$git_dir" ]]; then print "$git_dir" return 0 fi