Code

completion: use git rev-parse to detect bare repos
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 18 May 2009 16:24:30 +0000 (18:24 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 May 2009 01:35:23 +0000 (18:35 -0700)
Its check is more robust than a config check for core.bare

Trivially-Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash

index a0c5794828a6ed00a3608d9ec22046478da83e96..f44152c4331bb6a2de764e6dcc98c1ac39e517e5 100755 (executable)
@@ -132,7 +132,7 @@ __git_ps1 ()
                local c
 
                if [ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]; then
-                       if [ "true" = "$(git config --bool core.bare 2>/dev/null)" ]; then
+                       if [ "true" = "$(git rev-parse --is-bare-repository 2>/dev/null)" ]; then
                                c="BARE:"
                        else
                                b="GIT_DIR!"