mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
Merge 8be98c24b5 into f1934d2c76
This commit is contained in:
commit
ff30f1c920
1 changed files with 5 additions and 1 deletions
|
|
@ -29,6 +29,10 @@ function _omz_git_prompt_info() {
|
|||
|| ref=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null) \
|
||||
|| return 0
|
||||
|
||||
local tag
|
||||
tag=$(__git_prompt_git describe --tags --exact-match 2> /dev/null) \
|
||||
&& tag="(${tag})"
|
||||
|
||||
# Use global ZSH_THEME_GIT_SHOW_UPSTREAM=1 for including upstream remote info
|
||||
local upstream
|
||||
if (( ${+ZSH_THEME_GIT_SHOW_UPSTREAM} )); then
|
||||
|
|
@ -36,7 +40,7 @@ function _omz_git_prompt_info() {
|
|||
&& upstream=" -> ${upstream}"
|
||||
fi
|
||||
|
||||
echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}"
|
||||
echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref:gs/%/%%}${tag}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}"
|
||||
}
|
||||
|
||||
function _omz_git_prompt_status() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue