mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Add variables that can be used to wrap the git status prompt.
Also return if working copy is clean.
This commit is contained in:
parent
a738ca9b64
commit
c09b59d96a
1 changed files with 3 additions and 3 deletions
|
|
@ -32,8 +32,8 @@ function git_prompt_long_sha() {
|
||||||
|
|
||||||
# Get the status of the working tree
|
# Get the status of the working tree
|
||||||
git_prompt_status() {
|
git_prompt_status() {
|
||||||
INDEX=$(git status --porcelain 2> /dev/null)
|
INDEX=$(git status --porcelain 2> /dev/null) || return
|
||||||
STATUS=""
|
STATUS="$ZSH_THEME_GIT_STATUS_AFTER"
|
||||||
if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
|
if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
|
||||||
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
|
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
|
||||||
fi
|
fi
|
||||||
|
|
@ -60,5 +60,5 @@ git_prompt_status() {
|
||||||
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
|
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
|
||||||
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
|
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
|
||||||
fi
|
fi
|
||||||
echo $STATUS
|
echo "$ZSH_THEME_GIT_STATUS_BEFORE$STATUS"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue