mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +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:
parent
bfd2d8de24
commit
9f552130bd
9 changed files with 64 additions and 61 deletions
|
|
@ -5,7 +5,7 @@ function my_git_prompt() {
|
|||
STATUS=""
|
||||
|
||||
# is branch ahead?
|
||||
if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
|
||||
if $(echo "$(git log origin/$(git_current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
|
||||
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_AHEAD"
|
||||
fi
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ function my_git_prompt() {
|
|||
}
|
||||
|
||||
function my_current_branch() {
|
||||
echo $(current_branch || echo "(no branch)")
|
||||
echo $(git_current_branch || echo "(no branch)")
|
||||
}
|
||||
|
||||
function ssh_connection() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue