From 29a11032c619b287d14f1bb96e7a07e1054ea508 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Mon, 13 Jan 2020 14:59:22 +0100 Subject: [PATCH] Fix error in git prompt script --- bin/gitprompt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/gitprompt b/bin/gitprompt index 7e59c03..a093258 100755 --- a/bin/gitprompt +++ b/bin/gitprompt @@ -68,7 +68,7 @@ git__prompt () { if [ -z "$branch" ] then head=$(git rev-parse --short HEAD 2>&1) - if [[ "$head" =~ fatal* ]] + if [ $(echo "$head" | grep '^fatal') ] then branch='{no commits}' else @@ -78,7 +78,7 @@ git__prompt () { if [ "$branch" = 'master' ] then /bin/echo -ne " $blue$branch" - elif [ $(echo "$branch" | grep '^#' ) ] + elif [ $(echo "$branch" | grep '^#' ) ] then /bin/echo -ne " $red$branch" else