From cd7eaaa066d74588a9508c335240ed3e0248fab3 Mon Sep 17 00:00:00 2001 From: xiaogaozi Date: Fri, 4 May 2012 22:51:48 +0800 Subject: [PATCH] Change the test expression of Git --- .gitignore | 1 + themes/base.theme.bash | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 32e62de..25042cb 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ aliases/custom.aliases.bash lib/custom.bash plugins/custom.plugins.bash *.swp +.*.un~ diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 15bd4aa..f096fda 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -31,7 +31,7 @@ RBFU_THEME_PROMPT_PREFIX=' |' RBFU_THEME_PROMPT_SUFFIX='|' function scm { - if [[ -d .git ]]; then SCM=$SCM_GIT + if [[ -f .git/HEAD ]]; then SCM=$SCM_GIT elif [[ -n "$(git symbolic-ref HEAD 2> /dev/null)" ]]; then SCM=$SCM_GIT elif [[ -d .hg ]]; then SCM=$SCM_HG elif [[ -n "$(hg root 2> /dev/null)" ]]; then SCM=$SCM_HG -- 2.17.1