1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-17 10:10:07 +00:00

Better DETACHED_HEAD detection

This commit is contained in:
Niccolò Maggioni 2016-03-25 10:51:33 +01:00
parent 4fdf5df258
commit 1ab41d9a6c
No known key found for this signature in database
GPG key ID: 4874B0C841E33264

View file

@ -63,7 +63,7 @@ function +vi-git-remotebranch() {
function +vi-git-tagname() { function +vi-git-tagname() {
# Only show the tag name if we are not in DETACHED_HEAD state, # Only show the tag name if we are not in DETACHED_HEAD state,
# since in that case it would already be displayed in the branch segment # since in that case it would already be displayed in the branch segment
if [[ -n "$(git status | grep 'HEAD detached')" ]] ; then if [[ -z "$(git symbolic-ref HEAD 2>/dev/null)" ]] ; then
local tag local tag
tag=$(git describe --tags --exact-match HEAD 2>/dev/null) tag=$(git describe --tags --exact-match HEAD 2>/dev/null)