From 8af29c97c1239769e85a0444779cd97549301c94 Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Mon, 25 Jul 2022 17:18:08 -0400 Subject: [PATCH] fix custom _git_ps1 bug --- bash_tools/theme_bash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_tools/theme_bash.sh b/bash_tools/theme_bash.sh index 01456e8..1bb8829 100644 --- a/bash_tools/theme_bash.sh +++ b/bash_tools/theme_bash.sh @@ -6,7 +6,7 @@ if [[ $(type -t foo) != function ]]; then local branch=`git branch 2>/dev/null | grep '*' | sed 's/* \(.*\)/\1/'` - if [ $? ]; then + if [ -n "$branch" ]; then status=`git status 2>/dev/null` local stage_info="not staged for commit" local commit_info="Changes to be committed"