mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
Allow "staged" as result of parse_git_dirty().
If the corresponding parameter is not set "dirty" will be used as before.
This commit is contained in:
parent
303fb7286c
commit
667bcf3bbf
1 changed files with 7 additions and 6 deletions
13
lib/git.zsh
13
lib/git.zsh
|
|
@ -8,12 +8,13 @@ function git_prompt_info() {
|
|||
|
||||
# Checks if working tree is dirty
|
||||
parse_git_dirty() {
|
||||
local SUBMODULE_SYNTAX=''
|
||||
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
|
||||
SUBMODULE_SYNTAX="--ignore-submodules=dirty"
|
||||
fi
|
||||
if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then
|
||||
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
||||
gitstatus=$(git status --porcelain ${SUBMODULE_SYNTAX} 2> /dev/null)
|
||||
if [[ -n "$gitstatus" ]]; then
|
||||
if [[ "$gitstatus" =~ '^[MADRCU].*$' ]] && (($+ZSH_THEME_GIT_PROMPT_STAGED)); then
|
||||
echo "$ZSH_THEME_GIT_PROMPT_STAGED"
|
||||
else
|
||||
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
||||
fi
|
||||
else
|
||||
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue