Merge pull request #319 from jakob-erdmann/ahead_behind_branchname_fix

Ahead/Behind only if actually ahead/behind
master
Martin Gondermann 9 years ago committed by GitHub
commit ffc8c7bbf0
  1. 4
      gitstatus.sh

@ -86,11 +86,11 @@ else
IFS="[,]" read -ra remote_fields <<< "${branch_fields[1]}"
upstream="${remote_fields[0]}"
for remote_field in "${remote_fields[@]}"; do
if [[ "$remote_field" == *ahead* ]]; then
if [[ "$remote_field" == "ahead "* ]]; then
num_ahead=${remote_field:6}
ahead="_AHEAD_${num_ahead}"
fi
if [[ "$remote_field" == *behind* ]]; then
if [[ "$remote_field" == "behind "* ]] || [[ "$remote_field" == " behind "* ]]; then
num_behind=${remote_field:7}
behind="_BEHIND_${num_behind# }"
fi

Loading…
Cancel
Save