mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Added a function to provide Git stash info to the prompt
This commit is contained in:
parent
10991f800e
commit
2cd1323e0a
1 changed files with 7 additions and 0 deletions
|
|
@ -30,6 +30,13 @@ function git_prompt_long_sha() {
|
||||||
SHA=$(git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
|
SHA=$(git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Checks if there are stashed changes
|
||||||
|
function git_prompt_stash() {
|
||||||
|
if [[ -n $(git stash list 2> /dev/null) ]]; then
|
||||||
|
echo "$ZSH_THEME_GIT_PROMPT_STASH"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# 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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue