mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2025-12-06 07:20:40 +01:00
Move current_branch() from git plugin to core lib/git.zsh
Fixes #4085: core -> plugin dependency issue. Rename it to git_current_branch for clarity that it's git-specific. Update all plugins that were calling it to use new name. Fix variable leaks by making more variables in lib/git.zsh local. Have lib/git.zsh use [[ ]] instead of [ ] everywhere.
This commit is contained in:
@@ -9,7 +9,7 @@ function josh_prompt {
|
||||
(( spare_width = ${COLUMNS} ))
|
||||
prompt=" "
|
||||
|
||||
branch=$(current_branch)
|
||||
branch=$(git_current_branch)
|
||||
ruby_version=$(rvm_prompt_info || rbenv_prompt_info)
|
||||
path_size=${#PWD}
|
||||
branch_size=${#branch}
|
||||
@@ -31,7 +31,7 @@ function josh_prompt {
|
||||
prompt=" $prompt"
|
||||
done
|
||||
|
||||
prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%} $(current_branch)"
|
||||
prompt="%{%F{green}%}$PWD$prompt%{%F{red}%}$(rvm_prompt_info || rbenv_prompt_info)%{$reset_color%} $(git_current_branch)"
|
||||
|
||||
echo $prompt
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user