Merge pull request #128 from ldidry/badregex

Fix bad regex for submodule from #118
This commit is contained in:
nojhan 2013-03-25 12:07:45 -07:00
commit 7edb81287e

View File

@ -684,7 +684,7 @@ _lp_git_branch()
[[ "$LP_ENABLE_GIT" != 1 ]] && return [[ "$LP_ENABLE_GIT" != 1 ]] && return
local gitdir local gitdir
gitdir="$(git rev-parse --git-dir 2>/dev/null)" 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)" local branch="$(git symbolic-ref HEAD 2>/dev/null)"
if [[ $? -ne 0 || -z "$branch" ]] ; then if [[ $? -ne 0 || -z "$branch" ]] ; then
# In detached head state, use commit instead # In detached head state, use commit instead