git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date
May 18, 2009, 16:24 UTC
Message-ID
<1242663870-11895-1-git-send-email-giuseppe.bilotta@gmail.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
Next: Shawn O. Pearce
Message 1 of 2 in “completion: use git rev-parse to detect bare repos”
  1. completion: use git rev-parse to detect bare reposGiuseppe Bilotta, May 18, 2009
  2. Shawn O. PearceMay 20, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.