osrm-backend/scripts/travis/is_pr_merge.sh
Daniel J. Hofmann 2351b5a084 Merges node-osrm into repository
Build with

    cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=On -DENABLE_MASON=On
2017-03-21 20:10:39 +00:00

28 lines
778 B
Bash
Executable File

#!/bin/bash
set -eu pipefail
: '
This script is designed to detect if a gitsha represents a normal
push commit (to any branch) or whether it represents travis attempting
to merge between the origin and the upstream branch.
For more details see: https://docs.travis-ci.com/user/pull-requests
'
# Get the commit message via git log
# This should always be the exact text the developer provided
COMMIT_LOG=$(git log --format=%B --no-merges -n 1 | tr -d '\n')
# Get the commit message via git show
# If the gitsha represents a merge then this will
# look something like "Merge e3b1981 into 615d2a3"
# Otherwise it will be the same as the "git log" output
COMMIT_SHOW=$(git show -s --format=%B | tr -d '\n')
if [[ "${COMMIT_LOG}" != "${COMMIT_SHOW}" ]]; then
echo true
fi