# [PATCH] completion: use git rev-parse to detect bare repos

2 messages from 2009-05-18 to 2009-05-20. Participants: Giuseppe Bilotta, Shawn O. Pearce.
Thread: https://gitlist.dev/t/19407

## Giuseppe Bilotta, 2009-05-18 16:24

Subject: [PATCH] completion: use git rev-parse to detect bare repos
Message-ID: <1242663870-11895-1-git-send-email-giuseppe.bilotta@gmail.com>
URL: https://gitlist.dev/e/1242663870-11895-1-git-send-email-giuseppe.bilotta%40gmail.com

```
Its check is more robust than a config check for core.bare
---
 contrib/completion/git-completion.bash |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index ba13c49..0c8bb53 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -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!"
-- 
1.6.3.1.137.g29aa

```

## Shawn O. Pearce, 2009-05-20 22:54

Subject: Re: [PATCH] completion: use git rev-parse to detect bare repos
Message-ID: <20090520225430.GU30527@spearce.org>
URL: https://gitlist.dev/e/20090520225430.GU30527%40spearce.org
In-Reply-To: <1242663870-11895-1-git-send-email-giuseppe.bilotta@gmail.com>

```
Giuseppe Bilotta <giuseppe.bilotta@gmail.com> wrote:
> Its check is more robust than a config check for core.bare

Trivially-Acked-by: Shawn O. Pearce <spearce@spearce.org>

> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index ba13c49..0c8bb53 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -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!"
> -- 
> 1.6.3.1.137.g29aa
> 

-- 
Shawn.

```
