mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
Revert "fix(lib): don't return clean with hide-dirty=1
in parse_git_dirty
" (#10927)
This commit is contained in:
parent
d7fc9b87f9
commit
dfee71c773
1 changed files with 16 additions and 20 deletions
36
lib/git.zsh
36
lib/git.zsh
|
@ -34,30 +34,26 @@ function git_prompt_info() {
|
||||||
|
|
||||||
# Checks if working tree is dirty
|
# Checks if working tree is dirty
|
||||||
function parse_git_dirty() {
|
function parse_git_dirty() {
|
||||||
if [[ "$(__git_prompt_git config --get oh-my-zsh.hide-dirty)" == "1" ]]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
local STATUS
|
local STATUS
|
||||||
local -a FLAGS
|
local -a FLAGS
|
||||||
FLAGS=('--porcelain')
|
FLAGS=('--porcelain')
|
||||||
if [[ "${DISABLE_UNTRACKED_FILES_DIRTY:-}" == "true" ]]; then
|
if [[ "$(__git_prompt_git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then
|
||||||
FLAGS+='--untracked-files=no'
|
if [[ "${DISABLE_UNTRACKED_FILES_DIRTY:-}" == "true" ]]; then
|
||||||
|
FLAGS+='--untracked-files=no'
|
||||||
|
fi
|
||||||
|
case "${GIT_STATUS_IGNORE_SUBMODULES:-}" in
|
||||||
|
git)
|
||||||
|
# let git decide (this respects per-repo config in .gitmodules)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# if unset: ignore dirty submodules
|
||||||
|
# other values are passed to --ignore-submodules
|
||||||
|
FLAGS+="--ignore-submodules=${GIT_STATUS_IGNORE_SUBMODULES:-dirty}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
STATUS=$(__git_prompt_git status ${FLAGS} 2> /dev/null | tail -n 1)
|
||||||
fi
|
fi
|
||||||
|
if [[ -n $STATUS ]]; then
|
||||||
case "${GIT_STATUS_IGNORE_SUBMODULES:-}" in
|
|
||||||
git)
|
|
||||||
# let git decide (this respects per-repo config in .gitmodules)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
# if unset: ignore dirty submodules
|
|
||||||
# other values are passed to --ignore-submodules
|
|
||||||
FLAGS+="--ignore-submodules=${GIT_STATUS_IGNORE_SUBMODULES:-dirty}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
STATUS=$(__git_prompt_git status ${FLAGS} 2> /dev/null | tail -n 1)
|
|
||||||
if [[ -n "$STATUS" ]]; then
|
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
||||||
else
|
else
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
||||||
|
|
Loading…
Reference in a new issue