mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-20 03:02:29 +01:00
Use low level command to detect branches behind
Using git log is subject to formatting in .gitconfig, which can be overridden and will break this function. Relying on rev-list is much more stable.
This commit is contained in:
parent
f8f01262ab
commit
bc3adb4571
1 changed files with 1 additions and 1 deletions
|
|
@ -54,7 +54,7 @@ git_remote_status() {
|
|||
|
||||
# Checks if there are commits ahead from remote
|
||||
function git_prompt_ahead() {
|
||||
if $(echo "$(command git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
|
||||
if [[ -n "$(command git rev-list origin/$(current_branch)..HEAD 2> /dev/null)" ]]; then
|
||||
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue