build,travis: git rev-list can also error and return nothing
authorEtienne Champetier <champetier.etienne@gmail.com>
Sun, 13 Aug 2017 22:37:18 +0000 (15:37 -0700)
committerEtienne Champetier <champetier.etienne@gmail.com>
Sun, 13 Aug 2017 22:38:46 +0000 (15:38 -0700)
"fatal: Invalid revision range XXX...YYY"

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
.travis_do.sh

index 719c29ea0fef9c51dc3f4836f0487edc5c932844..cabb32380f73fafdeb6a68b9082f43ff5d3bdaad 100755 (executable)
@@ -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