mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-09 02:24:03 +01:00
Merge branch 'master' of git://github.com/robbyrussell/oh-my-zsh into old-git-status
Conflicts: lib/git.zsh
This commit is contained in:
commit
c7f80cb817
7 changed files with 72 additions and 30 deletions
26
lib/git.zsh
26
lib/git.zsh
|
|
@ -9,21 +9,23 @@ function git_prompt_info() {
|
|||
# Checks if working tree is dirty
|
||||
parse_git_dirty() {
|
||||
local SUBMODULE_SYNTAX=''
|
||||
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
|
||||
if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
|
||||
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
|
||||
SUBMODULE_SYNTAX="--ignore-submodules=dirty"
|
||||
fi
|
||||
local GIT_DIRTY=0
|
||||
# see https://github.com/robbyrussell/oh-my-zsh/commit/3c87d483628267e48fc0f462f46488dcd4f87810
|
||||
# and https://github.com/robbyrussell/oh-my-zsh/issues/40
|
||||
if [[ $POST_1_6_4_GIT -gt 0 ]]; then
|
||||
fi
|
||||
local GIT_DIRTY=0
|
||||
# see https://github.com/robbyrussell/oh-my-zsh/commit/3c87d483628267e48fc0f462f46488dcd4f87810
|
||||
# and https://github.com/robbyrussell/oh-my-zsh/issues/40
|
||||
if [[ $POST_1_6_4_GIT -gt 0 ]]; then
|
||||
[[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]] && GIT_DIRTY=1
|
||||
else
|
||||
else
|
||||
[[ $((git status 2> /dev/null) | tail -n1) != "nothing to commit (working directory clean)" ]] && GIT_DIRTY=1
|
||||
fi
|
||||
if (( GIT_DIRTY )); then
|
||||
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
||||
else
|
||||
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
||||
fi
|
||||
if (( GIT_DIRTY )); then
|
||||
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
||||
else
|
||||
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue