Browse Source

feat(git): display tag in git-prompt when possible (#11318)

Co-authored-by: Marc Cornellà <hello@mcornella.com>
Banst 1 year ago
parent
commit
6dfc9b960f
1 changed files with 1 additions and 0 deletions
  1. 1 0
      lib/git.zsh

+ 1 - 0
lib/git.zsh

@@ -19,6 +19,7 @@ function git_prompt_info() {
 
   local ref
   ref=$(__git_prompt_git symbolic-ref --short HEAD 2> /dev/null) \
+  || ref=$(__git_prompt_git describe --tags --exact-match HEAD 2> /dev/null) \
   || ref=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null) \
   || return 0