mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
don't assume "origin" in git_prompt_ahead()
it's possible that you are working on a tracking branch that tracks something else than origin. This uses the new git_current_upstream() function to determine the remote of the branch that is currently being tracked
This commit is contained in:
parent
22cf85c0f8
commit
8217193b73
1 changed files with 1 additions and 1 deletions
|
|
@ -15,7 +15,7 @@ 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 origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
|
if $(echo "$(git log $(git_current_upstream)/$(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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue