Browse Source

completion: use git rev-parse to detect bare repos

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>
maint
Giuseppe Bilotta 16 years ago committed by Junio C Hamano
parent
commit
8dfb17e1fd
  1. 2
      contrib/completion/git-completion.bash

2
contrib/completion/git-completion.bash

@ -132,7 +132,7 @@ __git_ps1 ()
local c local c


if [ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]; then 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:" c="BARE:"
else else
b="GIT_DIR!" b="GIT_DIR!"

Loading…
Cancel
Save