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
4674384d
Unverified
Commit
4674384d
authored
May 12, 2022
by
Will LE
Committed by
GitHub
May 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(lib): don't return clean with `hide-dirty=1` in `parse_git_dirty` (#10897)
parent
8f56a8bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
16 deletions
+20
-16
git.zsh
lib/git.zsh
+20
-16
No files found.
lib/git.zsh
View file @
4674384d
...
@@ -34,26 +34,30 @@ function git_prompt_info() {
...
@@ -34,26 +34,30 @@ 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
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