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
|
||||
git_prompt_status() {
|
||||
INDEX=$(git status --porcelain 2> /dev/null)
|
||||
STATUS=""
|
||||
INDEX=$(git status --porcelain 2> /dev/null) || return
|
||||
STATUS="$ZSH_THEME_GIT_STATUS_AFTER"
|
||||
if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
|
||||
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
|
||||
fi
|
||||
|
|
@ -60,5 +60,5 @@ git_prompt_status() {
|
|||
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
|
||||
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
|
||||
fi
|
||||
echo $STATUS
|
||||
echo "$ZSH_THEME_GIT_STATUS_BEFORE$STATUS"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue