Update __fish_git_prompt.fish to use 'else if'

This commit is contained in:
Kevin Ballard 2013-01-29 11:39:28 -08:00 committed by ridiculousfish
parent 3f8baeba20
commit 32b2c9fc9e

View File

@ -157,12 +157,10 @@ function __fish_git_prompt_show_upstream --description "Helper function for __fi
set upstream (/bin/sh -c 'echo "${1%/$2}"' -- $pattern $trunk)/$upstream
end
end
else
if test $upstream = svn+git
else if test $upstream = svn+git
set upstream '@{upstream}'
end
end
end
# Find how many commits we are ahead/behind our upstream
set -l count
@ -225,29 +223,25 @@ function __fish_git_prompt --description "Prompt function for Git"
if test -f $git_dir/rebase-merge/interactive
set r "|REBASE-i"
set b (cat $git_dir/rebase-merge/head-name)
else; if test -d $git_dir/rebase-merge
else if test -d $git_dir/rebase-merge
set r "|REBASE-m"
set b (cat $git_dir/rebase-merge/head-name)
else
if test -d $git_dir/rebase-apply
if test -f $git_dir/rebase-apply/rebasing
set r "|REBASE"
else; if test -f $git_dir/rebase-apply/applying
else if test -f $git_dir/rebase-apply/applying
set r "|AM"
else
set r "|AM/REBASE"
end
end
else; if test -f $git_dir/MERGE_HEAD
else if test -f $git_dir/MERGE_HEAD
set r "|MERGING"
else; if test -f $git_dir/CHERRY_PICK_HEAD
else if test -f $git_dir/CHERRY_PICK_HEAD
set r "|CHERRY-PICKING"
else; if test -f $git_dir/BISECT_LOG
else if test -f $git_dir/BISECT_LOG
set r "|BISECTING"
end
end
end
end
set -l os
set b (git symbolic-ref HEAD ^/dev/null; set os $status)
@ -271,7 +265,6 @@ function __fish_git_prompt --description "Prompt function for Git"
set b "($b)"
end
end
end
set -l w
set -l i
@ -288,7 +281,7 @@ function __fish_git_prompt --description "Prompt function for Git"
else
set b "GIT_DIR!"
end
else; if test "true" = (git rev-parse --is-inside-work-tree ^/dev/null)
else if test "true" = (git rev-parse --is-inside-work-tree ^/dev/null)
if test -n "$__fish_git_prompt_showdirtystate"
set -l config (git config --bool bash.showDirtyState)
if test "$config" != "false"
@ -315,7 +308,6 @@ function __fish_git_prompt --description "Prompt function for Git"
set p (__fish_git_prompt_show_upstream)
end
end
end
__fish_git_prompt_validate_colors