Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
dfee71c7
Unverified
Commit
dfee71c7
authored
May 12, 2022
by
Marc Cornellà
Committed by
GitHub
May 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "fix(lib): don't return clean with `hide-dirty=1` in `parse_git_dirty`" (#10927)
parent
d7fc9b87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
20 deletions
+16
-20
git.zsh
lib/git.zsh
+16
-20
No files found.
lib/git.zsh
View file @
dfee71c7
...
@@ -34,30 +34,26 @@ function git_prompt_info() {
...
@@ -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
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment