legacy-dotfiles/zsh/functions/prompt_git_info
2011-05-17 00:53:52 +02:00

23 lines
460 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+="↓"
;;
esac
if [ -n "$__CURRENT_GIT_BRANCH_IS_DIRTY" ]; then
s+="⚡"
fi
s+=")"
printf " %s%s" "%{${fg[yellow]}%}" $s
fi