diff --git a/lib/git.zsh b/lib/git.zsh index c4b5b5d62..842ce0755 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -114,6 +114,25 @@ git_prompt_status() { echo $STATUS } +# Checks if there is a bisect, merge or rebase currently going on +git_prompt_rebase_state() { + STATUS="" + + if [ -f ".git/BISECT_LOG" ] ; then + STATUS="$ZSH_THEME_GIT_PROMPT_STATE_BEFORE$ZSH_THEME_GIT_PROMPT_STATE_BISECT" + elif [ -f ".git/MERGE_HEAD" ] ; then + STATUS="$ZSH_THEME_GIT_PROMPT_STATE_BEFORE$ZSH_THEME_GIT_PROMPT_STATE_MERGE" + else + for dir in rebase rebase-apply rebase-merge ; do + if [ -d ".git/$dir" ] ; then + STATUS="$ZSH_THEME_GIT_PROMPT_STATE_BEFORE$ZSH_THEME_GIT_PROMPT_STATE_REBASE" + break + fi + done + fi + echo $STATUS +} + #compare the provided version of git to the version installed and on path #prints 1 if input version <= installed version #prints -1 otherwise diff --git a/themes/stibbons.zsh-theme b/themes/stibbons.zsh-theme index 1ee8c5bd9..946420f89 100644 --- a/themes/stibbons.zsh-theme +++ b/themes/stibbons.zsh-theme @@ -12,7 +12,7 @@ git_custom_status() { } #RVM and git settings -if [[ -s ~/.rvm/scripts/rvm ]] ; then +if [[ -s ~/.rvm/scripts/rvm ]] ; then RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1' else if which rbenv &> /dev/null; then