Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
1c070018
Unverified
Commit
1c070018
authored
Oct 17, 2013
by
David Sutherland
Committed by
Marc Cornellà
Dec 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(mercurial): correctly check for untracked files in `hg_dirty` (#2177)
Closes #2177 Closes #6197 Co-authored-by:
Henrik Ravn
<
hravnx@gmail.com
>
parent
4119f530
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
mercurial.plugin.zsh
plugins/mercurial/mercurial.plugin.zsh
+15
-3
No files found.
plugins/mercurial/mercurial.plugin.zsh
View file @
1c070018
...
...
@@ -91,13 +91,25 @@ function hg_prompt_info {
}
function
hg_dirty
{
local
hg_status
if
!
hg_status
=
"
$(
hg status
-mar
2>/dev/null
)
"
;
then
# Do nothing if clean / dirty settings aren't defined
if
[[
-z
"
$ZSH_THEME_HG_PROMPT_DIRTY
"
&&
-z
"
$ZSH_THEME_HG_PROMPT_CLEAN
"
]]
;
then
return
fi
# Check if there are modifications
local
hg_status
if
[[
"
$DISABLE_UNTRACKED_FILES_DIRTY
"
=
true
]]
;
then
if
!
hg_status
=
"
$(
hg status
-q
2>/dev/null
)
"
;
then
return
fi
else
if
!
hg_status
=
"
$(
hg status 2>/dev/null
)
"
;
then
return
fi
fi
# grep exits with 0 when dirty
if
command grep
-Eq
'^\s*[ACDIM
!?L]
'
<<<
"
$hg_status
"
;
then
if
command grep
-Eq
'^\s*[ACDIM
R!?L].*$
'
<<<
"
$hg_status
"
;
then
echo
$ZSH_THEME_HG_PROMPT_DIRTY
return
fi
...
...
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