Unverified Commit dfee71c7 authored by Marc Cornellà's avatar Marc Cornellà Committed by GitHub

Revert "fix(lib): don't return clean with `hide-dirty=1` in `parse_git_dirty`" (#10927)

parent d7fc9b87
...@@ -34,17 +34,13 @@ function git_prompt_info() { ...@@ -34,17 +34,13 @@ 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 [[ "$(__git_prompt_git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then
if [[ "${DISABLE_UNTRACKED_FILES_DIRTY:-}" == "true" ]]; then if [[ "${DISABLE_UNTRACKED_FILES_DIRTY:-}" == "true" ]]; then
FLAGS+='--untracked-files=no' FLAGS+='--untracked-files=no'
fi fi
case "${GIT_STATUS_IGNORE_SUBMODULES:-}" in case "${GIT_STATUS_IGNORE_SUBMODULES:-}" in
git) git)
# let git decide (this respects per-repo config in .gitmodules) # let git decide (this respects per-repo config in .gitmodules)
...@@ -55,9 +51,9 @@ function parse_git_dirty() { ...@@ -55,9 +51,9 @@ function parse_git_dirty() {
FLAGS+="--ignore-submodules=${GIT_STATUS_IGNORE_SUBMODULES:-dirty}" FLAGS+="--ignore-submodules=${GIT_STATUS_IGNORE_SUBMODULES:-dirty}"
;; ;;
esac esac
STATUS=$(__git_prompt_git status ${FLAGS} 2> /dev/null | tail -n 1) STATUS=$(__git_prompt_git status ${FLAGS} 2> /dev/null | tail -n 1)
if [[ -n "$STATUS" ]]; then fi
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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment