summaryrefslogtreecommitdiff
path: root/contrib/completion/git-completion.bash
diff options
context:
space:
mode:
authorLibravatar Marius Storm-Olsen <git@storm-olsen.com>2009-02-21 15:48:43 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-02-24 21:45:04 -0800
commitddb6d010231432ba75cf109aa7cd282912c88d2d (patch)
tree86fe38d0510c6024de89ebe4dd13e4c7ea4ac836 /contrib/completion/git-completion.bash
parentAdd bare repository indicator for __git_ps1 (diff)
downloadtgif-ddb6d010231432ba75cf109aa7cd282912c88d2d.tar.xz
Fixup: Add bare repository indicator for __git_ps1
Signed-off-by: Marius Storm-Olsen <git@storm-olsen.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion/git-completion.bash')
-rwxr-xr-xcontrib/completion/git-completion.bash13
1 files changed, 6 insertions, 7 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index a61d852a14..dd393cd004 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -117,9 +117,14 @@ __git_ps1 ()
local w
local i
+ local c
if [ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]; then
- b="GIT_DIR!"
+ if [ "true" = "$(git config --bool core.bare 2>/dev/null)" ]; then
+ c="BARE:"
+ else
+ b="GIT_DIR!"
+ fi
elif [ "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then
if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ]; then
if [ "$(git config --bool bash.showDirtyState)" != "false" ]; then
@@ -135,12 +140,6 @@ __git_ps1 ()
fi
fi
- local c
-
- if [ "true" = "$(git config --bool core.bare 2>/dev/null)" ]; then
- c="BARE:"
- fi
-
if [ -n "$b" ]; then
if [ -n "${1-}" ]; then
printf "$1" "$c${b##refs/heads/}$w$i$r"