X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=scripts%2Fgetver.sh;h=d5f29864b57b24b2dab693ad88c58da4b4dcc623;hb=d2b79e4d808add264d22e284fa21dfa155e52f05;hp=a65a6af22847f45e3188baeb527590b8a7cb58be;hpb=7ed215437c784eb466302a5c01a4ee2fff9eac2d;p=openwrt%2Fstaging%2Fyousong.git diff --git a/scripts/getver.sh b/scripts/getver.sh index a65a6af228..d5f29864b5 100755 --- a/scripts/getver.sh +++ b/scripts/getver.sh @@ -25,15 +25,15 @@ try_git() { ;; *) BRANCH="$(git rev-parse --abbrev-ref HEAD)" - ORIGIN="$(git rev-parse --symbolic-full-name ${BRANCH}@{u} 2>/dev/null)" - [ -n "$ORIGIN" ] || ORIGIN="$(git rev-parse --symbolic-full-name master@{u} 2>/dev/null)" + ORIGIN="$(git rev-parse --verify --symbolic-full-name ${BRANCH}@{u} 2>/dev/null)" + [ -n "$ORIGIN" ] || ORIGIN="$(git rev-parse --verify --symbolic-full-name master@{u} 2>/dev/null)" REV="$(git rev-list ${REBOOT}..$GET_REV | wc -l | awk '{print $1}')" if [ -n "$ORIGIN" ]; then UPSTREAM_BASE="$(git merge-base $GET_REV $ORIGIN)" UPSTREAM_REV="$(git rev-list ${REBOOT}..$UPSTREAM_BASE | wc -l | awk '{print $1}')" else - UPSTREAM_REV=$REV + UPSTREAM_REV=0 fi if [ "$REV" -gt "$UPSTREAM_REV" ]; then