diff --git a/tools/ci.sh b/tools/ci.sh index efa492bd19..975ce86172 100755 --- a/tools/ci.sh +++ b/tools/ci.sh @@ -44,7 +44,9 @@ function ci_code_spell_run { function ci_commit_formatting_run { git remote add upstream https://github.com/micropython/micropython.git - git fetch --depth=100 upstream master + git fetch --depth=100 upstream master + # If the common ancestor commit hasn't been found, fetch more. + git merge-base upstream/master HEAD || git fetch --unshallow upstream master # For a PR, upstream/master..HEAD ends with a merge commit into master, exclude that one. tools/verifygitlog.py -v upstream/master..HEAD --no-merges } @@ -68,6 +70,8 @@ function ci_code_size_build { git checkout -b pull_request # save the current location git remote add upstream https://github.com/micropython/micropython.git git fetch --depth=100 upstream master + # If the common ancestor commit hasn't been found, fetch more. + git merge-base upstream/master HEAD || git fetch --unshallow upstream master # build reference, save to size0 # ignore any errors with this build, in case master is failing git checkout `git merge-base --fork-point upstream/master pull_request`