if [ -n "$g" ]; then
local r
local b
- if [ -d "$g/rebase-apply" ]; then
- if [ -f "$g/rebase-apply/rebasing" ]; then
- r="|REBASE"
- elif [ -f "$g/rebase-apply/applying" ]; then
- r="|AM"
- else
- r="|AM/REBASE"
- fi
- b="$(git symbolic-ref HEAD 2>/dev/null)"
- elif [ -f "$g/rebase-merge/interactive" ]; then
+ if [ -f "$g/rebase-merge/interactive" ]; then
r="|REBASE-i"
b="$(cat "$g/rebase-merge/head-name")"
elif [ -d "$g/rebase-merge" ]; then
r="|REBASE-m"
b="$(cat "$g/rebase-merge/head-name")"
else
- if [ -f "$g/MERGE_HEAD" ]; then
+ if [ -d "$g/rebase-apply" ]; then
+ if [ -f "$g/rebase-apply/rebasing" ]; then
+ r="|REBASE"
+ elif [ -f "$g/rebase-apply/applying" ]; then
+ r="|AM"
+ else
+ r="|AM/REBASE"
+ fi
+ elif [ -f "$g/MERGE_HEAD" ]; then
r="|MERGING"
- fi
- if [ -f "$g/BISECT_LOG" ]; then
+ elif [ -f "$g/BISECT_LOG" ]; then
r="|BISECTING"
fi
local c
if [ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]; then
- if [ "true" = "$(git config --bool core.bare 2>/dev/null)" ]; then
+ if [ "true" = "$(git rev-parse --is-bare-repository 2>/dev/null)" ]; then
c="BARE:"
else
b="GIT_DIR!"
fi
fi
- if [ -n "$b" ]; then
- if [ -n "${1-}" ]; then
- printf "$1" "$c${b##refs/heads/}$w$i$r"
- else
- printf " (%s)" "$c${b##refs/heads/}$w$i$r"
- fi
+ if [ -n "${1-}" ]; then
+ printf "$1" "$c${b##refs/heads/}$w$i$r"
+ else
+ printf " (%s)" "$c${b##refs/heads/}$w$i$r"
fi
fi
}
__gitcomp "$(__git_merge_strategies)"
return
;;
- color.branch|color.diff|color.interactive|color.status|color.ui)
+ color.branch|color.diff|color.interactive|\
+ color.showbranch|color.status|color.ui)
__gitcomp "always never auto"
return
;;
color.interactive.help
color.interactive.prompt
color.pager
+ color.showbranch
color.status
color.status.added
color.status.changed
__gitcomp "
--all --remotes --topo-order --current --more=
--list --independent --merge-base --no-name
+ --color --no-color
--sha1-name --sparse --topics --reflog
"
return