From dede62cf88b0c33281fb491723477bc1bbacc5e5 Mon Sep 17 00:00:00 2001 From: Etienne Champetier Date: Sun, 13 Aug 2017 15:37:18 -0700 Subject: [PATCH] build,travis: git rev-list can also error and return nothing "fatal: Invalid revision range XXX...YYY" Signed-off-by: Etienne Champetier --- .travis_do.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis_do.sh b/.travis_do.sh index 719c29ea0f..cabb32380f 100755 --- a/.travis_do.sh +++ b/.travis_do.sh @@ -165,8 +165,10 @@ echo_blue "=== Travis ENV" env echo_blue "=== Travis ENV" -until [ "$(git rev-list ${TRAVIS_COMMIT_RANGE/.../..} | tail -n1)" != "a22de9b74cf9579d1ce7e6cf1845b4afa4277b00" ]; do - # if clone depth is too small, git rev-list / diff return incorrect results +while true; do + # if clone depth is too small, git rev-list / diff return incorrect or empty results + C="$(git rev-list ${TRAVIS_COMMIT_RANGE/.../..} | tail -n1)" 2>/dev/null + [ -n "$C" -a "$C" != "a22de9b74cf9579d1ce7e6cf1845b4afa4277b00" ] && break echo_blue "Fetching 50 commits more" git fetch origin --deepen=50 done