From a1db31b7e3e79f1dba5a10eca3e79fa02acd68df Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Mon, 25 Mar 2013 19:40:04 +0100 Subject: [PATCH] Fix bad regex for submodule from #118 The regex in bash and zsh doesn't need to be quoted. It resulted a bad regex warning in zsh (#127) and it didn't worked in submodule. Plus, bash and zsh regexes have perlish syntax. --- liquidprompt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liquidprompt b/liquidprompt index 98f44f5..460ad87 100755 --- a/liquidprompt +++ b/liquidprompt @@ -684,7 +684,7 @@ _lp_git_branch() [[ "$LP_ENABLE_GIT" != 1 ]] && return local gitdir gitdir="$(git rev-parse --git-dir 2>/dev/null)" - [[ $? -ne 0 || $gitdir =~ '*/.git*' ]] && return + [[ $? -ne 0 || ! $gitdir =~ (.*\/)?\.git.* ]] && return local branch="$(git symbolic-ref HEAD 2>/dev/null)" if [[ $? -ne 0 || -z "$branch" ]] ; then # In detached head state, use commit instead