blob: 1e5cc2dbb8bbc5919e3a68d5b9cd035dacfa7102 [file] [log] [blame]
Erwan Gouriou831fbed2019-03-08 11:39:59 +01001#!/bin/sh
2#
3# Copyright (c) 2019 Linaro Limited
4#
5# SPDX-License-Identifier: Apache-2.0
6#
7
8remote=$1
9url=$2
10local_ref=$3
11local_sha=$4
12remote_ref=$5
13remote_sha=$6
14z40=0000000000000000000000000000000000000000
15
16set -e exec
17
18echo "Run push "
19
20if [ "$local_sha" = $z40 ]
21then
22 # Handle delete
23 :
24else
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 Gouriou7f847872019-03-11 08:52:41 +010036 ${ZEPHYR_BASE}/scripts/checkpatch.pl --git $range
Erwan Gouriou831fbed2019-03-08 11:39:59 +010037fi