15 lines
550 B
Bash
15 lines
550 B
Bash
local ref dirty
|
|
if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
|
|
ZSH_THEME_GIT_PROMPT_DIRTY='±'
|
|
dirty=$(git_status_dirty)
|
|
stash=$(git_stash_dirty)
|
|
ref=$(git symbolic-ref HEAD 2> /dev/null) \
|
|
|| ref="➦ $(git describe --exact-match --tags HEAD 2> /dev/null)" \
|
|
|| ref="➦ $(git show-ref --head -s --abbrev | head -n1 2> /dev/null)"
|
|
if [[ -n $dirty ]]; then
|
|
prompt_segment yellow black
|
|
else
|
|
prompt_segment green black
|
|
fi
|
|
PR="$PR${ref/refs\/heads\// }$stash$dirty"
|
|
fi
|