Simplified old gitstatus, eliminating a git command if no upstream branch is found

master
oGre 10 years ago
parent 21992de10b
commit 8894a5f84a
  1. 14
      gitstatus_pre-1.7.10.sh

@ -84,12 +84,6 @@ else
upstream=$( git rev-parse --abbrev-ref ${branch}@{upstream} 2>&1 )
if [[ $? == 0 ]]; then
has_remote_tracking=1
else
has_remote_tracking=0
unset upstream
fi
# get the revision list, and count the leading "<" and ">"
revgit=$( git rev-list --left-right ${remote_ref}...HEAD 2>/dev/null )
if [[ $? == 0 ]]; then
@ -103,16 +97,16 @@ else
remote="${remote}_AHEAD_${num_ahead}"
fi
fi
else
remote='_NO_REMOTE_TRACKING_'
unset upstream
fi
fi
if [[ -z "$remote" ]] ; then
remote='.'
fi
if [[ "$has_remote_tracking" == "0" ]] ; then
remote='_NO_REMOTE_TRACKING_'
fi
if [[ -z "$upstream" ]] ; then
upstream='^'
fi

Loading…
Cancel
Save