threads / patch / 19407

patchcompletion: use git rev-parse to detect bare repos

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

## tl;dr

2 messages between May 18, 2009 and May 20, 2009. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Giuseppe Bilotta· May 18, 2009, 16:24 UTC · lore
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(-)
Show changes to contrib/completion/git-completion.bash +1 −1
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· May 20, 2009, 22:54 UTC · re: Giuseppe Bilotta · lore

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

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>
Show 16 quoted lines
> 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.

← back to recent threads