build,travis: fetch commits until we find merge-base 4618/head
authorEtienne Champetier <champetier.etienne@gmail.com>
Mon, 24 Jul 2017 18:08:55 +0000 (11:08 -0700)
committerEtienne Champetier <champetier.etienne@gmail.com>
Mon, 24 Jul 2017 19:01:09 +0000 (12:01 -0700)
if the merge-base is not in the initial clone,
git diff / git rev-list will return funky results

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

index ee321b375e884f5e227a5b4a0da7fbec2f9337e9..ec74c3683fbf0aa6e4b8f71e7f957381f421c3d2 100644 (file)
@@ -1,5 +1,5 @@
 git:
-  depth: 1
+  depth: 10
 language: c
 dist: trusty
 sudo: false
index 673dced26db1b13887e2940f84eabd6e9a07b6f3..f2fc9c6038bfe440bec8517327bcfbf63626dfc1 100755 (executable)
@@ -146,6 +146,11 @@ echo_blue "=== Travis ENV"
 env
 echo_blue "=== Travis ENV"
 
+until git merge-base ${TRAVIS_COMMIT_RANGE/.../ } > /dev/null; do
+       echo_blue "Fetching 50 commits more"
+       git fetch origin --deepen=50
+done
+
 if [ "$TRAVIS_PULL_REQUEST" = false ] ; then
        echo "Only Pull Requests are supported at the moment." >&2
        exit 0