Update liquidprompt.theme.bash

pull/2175/head
Darren Bishop 2022-11-28 15:03:50 +00:00 committed by GitHub
parent 58bae6f900
commit e2fbfa6c73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -40,10 +40,11 @@ _lp_git_branch()
# not 1.7.9 (Ubuntu 12.04)
if branch="$(\git symbolic-ref -q HEAD)"; then
__lp_escape "$(\git rev-parse --short=5 -q HEAD 2>/dev/null):${branch#refs/heads/}"
lp_vcs_branch="$ret"
else
# In detached head state, use commit instead
# No escape needed
\git rev-parse --short -q HEAD 2>/dev/null
lp_vcs_branch="$(\git rev-parse --short -q HEAD 2>/dev/null)"
fi
}