summaryrefslogblamecommitdiffstats
path: root/prompt.sh
blob: 99ac6b360abe655642e019b06f06a78dcd9578dd (plain) (tree)






















                                                
source ./git-base.sh

local_ahead="$(commits_ahead_of_remote)"
ahead_arrow="↑"

if [[ ("$local_ahead" -gt 0) ]]; then
  local_ahead=" ${local_ahead}${ahead_arrow}"
else
  local_ahead=""
fi

local_behind="$(commits_behind_of_remote)"
behind_arrow="↓"

if [[ "$local_behind" -gt "0" ]]; then
  local_behind=" ${local_behind}${behind_arrow}"
else
  local_behind=""
fi

prompt="$(branch_name)$local_ahead$local_behind"

echo $prompt