23 lines
454 B
Bash
Executable file
23 lines
454 B
Bash
Executable file
# -*- mode: shell-script -*-
|
|
|
|
if [ -n "$__CURRENT_GIT_BRANCH" ]; then
|
|
local s="("
|
|
s+="$__CURRENT_GIT_BRANCH"
|
|
case "$__CURRENT_GIT_BRANCH_STATUS" in
|
|
ahead)
|
|
s+="^"
|
|
;;
|
|
diverged)
|
|
s+="-/="
|
|
;;
|
|
behind)
|
|
s+="v"
|
|
;;
|
|
esac
|
|
if [ -n "$__CURRENT_GIT_BRANCH_IS_DIRTY" ]; then
|
|
s+="*"
|
|
fi
|
|
s+=")"
|
|
|
|
printf " %s%s" "%{${fg[yellow]}%}" $s
|
|
fi
|