6dfc9b960f023f30d6c55a22fa8402d91beb8d1f

Author
Banst <bastyen.a@gmail.com>
Committer
GitHub <noreply@github.com>
Date

Message

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

Co-authored-by: Marc Cornellà <hello@mcornella.com>

Diff

 1diff --git a/lib/git.zsh b/lib/git.zsh
 2index be9fa7e6750b2fb44ec463bb98c0e4dddce4547f..f049f73c2029ee21018a4f2b9d31e49f2a09b27f 100644
 3--- a/lib/git.zsh
 4+++ b/lib/git.zsh
 5@@ -19,6 +19,7 @@ function git_prompt_info() {
 6 
 7   local ref
 8   ref=$(__git_prompt_git symbolic-ref --short HEAD 2> /dev/null) \
 9+  || ref=$(__git_prompt_git describe --tags --exact-match HEAD 2> /dev/null) \
10   || ref=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null) \
11   || return 0
12