mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Succumbed to Peer Pressure
Change git_current_branch to current_branch.
This commit is contained in:
parent
77f3689b82
commit
6c9fa1a13c
1 changed files with 3 additions and 8 deletions
11
lib/git.zsh
11
lib/git.zsh
|
|
@ -15,13 +15,13 @@ function parse_git_dirty() {
|
||||||
|
|
||||||
# Checks if there are commits ahead from remote
|
# Checks if there are commits ahead from remote
|
||||||
function git_prompt_ahead() {
|
function git_prompt_ahead() {
|
||||||
if $(echo "$(git log $(git_current_remote)/$(git_current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
|
if $(echo "$(git log $(git_current_remote)/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
|
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function git_prompt_behind() {
|
function git_prompt_behind() {
|
||||||
if $(echo "$(git log HEAD..$(git_current_remote)/$(git_current_branch) 2> /dev/null)" | grep '^commit' &> /dev/null); then
|
if $(echo "$(git log HEAD..$(git_current_remote)/$(current_branch) 2> /dev/null)" | grep '^commit' &> /dev/null); then
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_BEHIND"
|
echo "$ZSH_THEME_GIT_PROMPT_BEHIND"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
@ -67,13 +67,8 @@ function git_prompt_status() {
|
||||||
echo $STATUS
|
echo $STATUS
|
||||||
}
|
}
|
||||||
|
|
||||||
function git_current_branch() {
|
|
||||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
|
|
||||||
echo ${ref#refs/heads/}
|
|
||||||
}
|
|
||||||
|
|
||||||
function git_current_remote() {
|
function git_current_remote() {
|
||||||
remote=$(git config --get "branch.$(git_current_branch).remote")
|
remote=$(git config --get "branch.$(current_branch).remote")
|
||||||
if [ -z "$remote" ]; then
|
if [ -z "$remote" ]; then
|
||||||
echo 'origin'
|
echo 'origin'
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue