fi
done < <(${(z)status_cmd} 2> /dev/null)
- local git_status=" "
+ local git_status=" "
+ # Format tags
+ local tags=( $(git tag --points-at) )
+ if (( ${#tags} > 0 )); then
+ local icon=
+ (( ${#tags} > 1)) && icon=
+ git_status+="$icon%{$fg_bold[yellow]%}${(j:,:)tags}"
+ elif [[ "$head" == '(detached)' ]]; then
+ git_status+="%{$fg_bold[white]%}"
+ fi
- # Format branch and commit
- git_status+="%{$fg_bold[green]%}$head"
+ if [[ "$head" != '(detached)' ]]; then
+ git_status+="%{$fg_bold[green]%}$head"
+ fi
git_status+="%{$fg_no_bold[yellow]%}(${oid[1,8]})"
# Format upstream