mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-27 03:14:56 +01:00
Merge bd6122e178 into 9eaf51107f
This commit is contained in:
commit
93d4598deb
1 changed files with 3 additions and 3 deletions
|
|
@ -51,15 +51,15 @@ git_remote_status() {
|
||||||
|
|
||||||
# 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 "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
|
if [ -n "$(command git log --pretty=oneline @{upstream}..HEAD 2> /dev/null)" ]; then
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
|
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Gets the number of commits ahead from remote
|
# Gets the number of commits ahead from remote
|
||||||
function git_commits_ahead() {
|
function git_commits_ahead() {
|
||||||
if $(echo "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
|
if [ -n "$(command git log --pretty=oneline @{upstream}..HEAD 2> /dev/null)" ]; then
|
||||||
COMMITS=$(command git log @{upstream}..HEAD | grep '^commit' | wc -l | tr -d ' ')
|
COMMITS=$(command git log --pretty=oneline @{upstream}..HEAD | wc -l | tr -d ' ')
|
||||||
echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$COMMITS$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
|
echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$COMMITS$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue