diff options
author | Petr Štetiar <ynezz@true.cz> | 2020-03-03 12:47:07 +0100 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2020-11-02 08:39:49 +0100 |
commit | f52aee0455f6ce77b16a78ddf17f1ef49ddc2380 (patch) | |
tree | 252d03d1d02c84466ed270aa833a1df466463777 /scripts | |
parent | e48aac89a223906c3afcf59d15fcf138cc5f6c5e (diff) | |
download | upstream-f52aee0455f6ce77b16a78ddf17f1ef49ddc2380.tar.gz upstream-f52aee0455f6ce77b16a78ddf17f1ef49ddc2380.tar.bz2 upstream-f52aee0455f6ce77b16a78ddf17f1ef49ddc2380.zip |
scripts/getver.sh: silence rev-list errors
Shallow copies are quite common on CI platforms nowadays, making REBOOT
tag unavailable, thus producing following confusing errors in the build
logs:
fatal: Invalid revision range ee53a240ac902dc83209008a2671e7fdcf55957a..HEAD
fatal: Invalid revision range ee53a240ac902dc83209008a2671e7fdcf55957a..0493d57e04774d47921a7d2014b567455d5dc16b
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/getver.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/getver.sh b/scripts/getver.sh index 9175f411db..49260a2260 100755 --- a/scripts/getver.sh +++ b/scripts/getver.sh @@ -20,18 +20,18 @@ try_git() { case "$GET_REV" in r*) GET_REV="$(echo $GET_REV | tr -d 'r')" - BASE_REV="$(git rev-list ${REBOOT}..HEAD | wc -l | awk '{print $1}')" + BASE_REV="$(git rev-list ${REBOOT}..HEAD 2>/dev/null | wc -l | awk '{print $1}')" REV="$(git rev-parse HEAD~$((BASE_REV - GET_REV)))" ;; *) BRANCH="$(git rev-parse --abbrev-ref HEAD)" 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}')" + REV="$(git rev-list ${REBOOT}..$GET_REV 2>/dev/null | 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}')" + UPSTREAM_REV="$(git rev-list ${REBOOT}..$UPSTREAM_BASE 2>/dev/null | wc -l | awk '{print $1}')" else UPSTREAM_REV=0 fi |