mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-16 02:27:03 +01:00
Modify git_prompt_info to _not_ check git repository status when configuration option is specified and does not match current hostname.
This commit is contained in:
parent
615e41b0ec
commit
848dcba5f0
1 changed files with 5 additions and 3 deletions
|
|
@ -1,8 +1,10 @@
|
||||||
# get the name of the branch we are on
|
# get the name of the branch we are on
|
||||||
function git_prompt_info() {
|
function git_prompt_info() {
|
||||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
|
if [[ "$(git config --get oh-my-zsh.show-branch-on-only)" == "$(hostname)" || -z "$(git config --get oh-my-zsh.show-branch-on-only)" ]]; then
|
||||||
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
|
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
|
||||||
|
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue