Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two more variables to wrap the git status prompt #530

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/git.zsh
Expand Up @@ -32,7 +32,7 @@ function git_prompt_long_sha() {

# Get the status of the working tree
git_prompt_status() {
INDEX=$(git status --porcelain 2> /dev/null)
INDEX=$(git status --porcelain 2> /dev/null) || return
STATUS=""
if $(echo "$INDEX" | grep '^?? ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
Expand Down Expand Up @@ -60,5 +60,7 @@ git_prompt_status() {
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
fi
echo $STATUS
if [[ "$STATUS" != "" ]]; then
echo "$ZSH_THEME_GIT_STATUS_BEFORE$STATUS$ZSH_THEME_GIT_STATUS_AFTER"
fi
}