scripts/getver.sh: fix older git versions from printing stuff to stdout
[openwrt/openwrt.git] / scripts / getver.sh
index a65a6af22847f45e3188baeb527590b8a7cb58be..e718485852d427300892f412dba320a494a1c23f 100755 (executable)
@@ -25,8 +25,8 @@ 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