1
0
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:
Andrew Janke
2015-06-25 15:04:01 -04:00
parent bfd2d8de24
commit 9f552130bd
9 changed files with 64 additions and 61 deletions

View File

@@ -14,9 +14,9 @@ ZSH_THEME_GIT_PROMPT_CLEAN=""
# Customized git status, oh-my-zsh currently does not allow render dirty status before branch
git_custom_status() {
local cb=$(current_branch)
local cb=$(git_current_branch)
if [ -n "$cb" ]; then
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(git_current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}