mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-06-05 05:03:16 +02:00
Merge remote-tracking branch 'upstream/master'
# Conflicts: # plugins/npm/npm.plugin.zsh
This commit is contained in:
commit
e357d762b5
37 changed files with 2399 additions and 591 deletions
|
|
@ -86,8 +86,8 @@ function git_current_branch() {
|
|||
# Gets the number of commits ahead from remote
|
||||
function git_commits_ahead() {
|
||||
if command git rev-parse --git-dir &>/dev/null; then
|
||||
local commits="$(git rev-list --count @{upstream}..HEAD)"
|
||||
if [[ "$commits" != 0 ]]; then
|
||||
local commits="$(git rev-list --count @{upstream}..HEAD 2>/dev/null)"
|
||||
if [[ -n "$commits" && "$commits" != 0 ]]; then
|
||||
echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$commits$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
|
||||
fi
|
||||
fi
|
||||
|
|
@ -96,8 +96,8 @@ function git_commits_ahead() {
|
|||
# Gets the number of commits behind remote
|
||||
function git_commits_behind() {
|
||||
if command git rev-parse --git-dir &>/dev/null; then
|
||||
local commits="$(git rev-list --count HEAD..@{upstream})"
|
||||
if [[ "$commits" != 0 ]]; then
|
||||
local commits="$(git rev-list --count HEAD..@{upstream} 2>/dev/null)"
|
||||
if [[ -n "$commits" && "$commits" != 0 ]]; then
|
||||
echo "$ZSH_THEME_GIT_COMMITS_BEHIND_PREFIX$commits$ZSH_THEME_GIT_COMMITS_BEHIND_SUFFIX"
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue