if [[ "$line" == \#\ * ]]; then
[[ "$line" =~ '# branch.oid ([0-9a-f]+)' ]] && oid=$match[1]
[[ "$line" =~ '# branch.head (.*)' ]] && head=$match[1]
+ [[ "$line" =~ '# branch.upstream (.*)' ]] && upstream=$match[1]
[[ "$line" =~ '# branch.ab \+([0-9]+) -([0-9]+)' ]] && ahead=$match[1] && behind=$match[2]
else
# Count added, deleted, modified, renamed, unmerged, untracked, dirty.
# Format upstream
local upstream_str
+ [[ -z "$upstream" ]] && upstream_str+="%{$fg[blue]%} Ɇ"
(( ahead > 0 )) && upstream_str+="%{$fg[blue]%} >$ahead"
(( behind > 0 )) && upstream_str+="%{$fg[blue]%} <$behind"
git_status+="$upstream_str"