Erwan Gouriou | 831fbed | 2019-03-08 11:39:59 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (c) 2019 Linaro Limited |
| 4 | # |
| 5 | # SPDX-License-Identifier: Apache-2.0 |
| 6 | # |
| 7 | |
| 8 | remote=$1 |
| 9 | url=$2 |
| 10 | local_ref=$3 |
| 11 | local_sha=$4 |
| 12 | remote_ref=$5 |
| 13 | remote_sha=$6 |
| 14 | z40=0000000000000000000000000000000000000000 |
| 15 | |
| 16 | set -e exec |
| 17 | |
| 18 | echo "Run push " |
| 19 | |
| 20 | if [ "$local_sha" = $z40 ] |
| 21 | then |
| 22 | # Handle delete |
| 23 | : |
| 24 | else |
| 25 | if [ "$remote_sha" = $z40 ] |
| 26 | then |
| 27 | # New branch, examine all commits since $remote/master |
| 28 | base_commit=`git rev-parse $remote/master` |
| 29 | range="$base_commit..$local_sha" |
| 30 | else |
| 31 | # Update to existing branch, examine new commits |
| 32 | range="$remote_sha..$local_sha" |
| 33 | fi |
| 34 | |
| 35 | echo "Perform check patch" |
Erwan Gouriou | 7f84787 | 2019-03-11 08:52:41 +0100 | [diff] [blame] | 36 | ${ZEPHYR_BASE}/scripts/checkpatch.pl --git $range |
Erwan Gouriou | 831fbed | 2019-03-08 11:39:59 +0100 | [diff] [blame] | 37 | fi |