Skip to content

Commit

Permalink
feat(agnoster): add git tag to prompt (ohmyzsh#8417)
Browse files Browse the repository at this point in the history
Co-authored-by: Jakub Novotny <jakub.novotny@deutsche-boerse.com>
  • Loading branch information
jabunovoty and Jakub Novotny committed Jul 25, 2023
1 parent e564793 commit 4188b22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion themes/agnoster.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ prompt_git() {
if [[ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]]; then
repo_path=$(git rev-parse --git-dir 2>/dev/null)
dirty=$(parse_git_dirty)
ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="$(git rev-parse --short HEAD 2> /dev/null)"
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
ref="$(git describe --exact-match --tags HEAD 2> /dev/null)" || \
ref="$(git rev-parse --short HEAD 2> /dev/null)"
if [[ -n $dirty ]]; then
prompt_segment yellow black
else
Expand Down

0 comments on commit 4188b22

Please sign in to comment.