blob: fac10ccfbefd8e5675e4f06d57b12bc4aaa42ce3 [file] [log] [blame]
Manuel Pégourié-Gonnard845e4082020-07-16 10:53:13 +02001#!/bin/sh
2
3# pre-commit.sh
4#
Bence Szépkúti44bfbe32020-08-19 16:54:51 +02005# Copyright The Mbed TLS Contributors
Bence Szépkúti9df64ad2020-08-19 17:17:56 +02006# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
7#
8# This file is provided under the Apache License 2.0, or the
9# GNU General Public License v2.0 or later.
10#
11# **********
12# Apache License 2.0:
Manuel Pégourié-Gonnard845e4082020-07-16 10:53:13 +020013#
14# Licensed under the Apache License, Version 2.0 (the "License"); you may
15# not use this file except in compliance with the License.
16# You may obtain a copy of the License at
17#
18# http://www.apache.org/licenses/LICENSE-2.0
19#
20# Unless required by applicable law or agreed to in writing, software
21# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
22# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23# See the License for the specific language governing permissions and
24# limitations under the License.
Bence Szépkúti9df64ad2020-08-19 17:17:56 +020025#
26# **********
27#
28# **********
29# GNU General Public License v2.0 or later:
30#
31# This program is free software; you can redistribute it and/or modify
32# it under the terms of the GNU General Public License as published by
33# the Free Software Foundation; either version 2 of the License, or
34# (at your option) any later version.
35#
36# This program is distributed in the hope that it will be useful,
37# but WITHOUT ANY WARRANTY; without even the implied warranty of
38# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39# GNU General Public License for more details.
40#
41# You should have received a copy of the GNU General Public License along
42# with this program; if not, write to the Free Software Foundation, Inc.,
43# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
44#
45# **********
Manuel Pégourié-Gonnard845e4082020-07-16 10:53:13 +020046
47# Purpose
48#
49# This script does quick sanity checks before commiting:
50# - check that generated files are up-to-date.
51#
52# It is meant to be called as a git pre-commit hook, see README.md.
53#
54# From the git sample pre-commit hook:
55# Called by "git commit" with no arguments. The hook should
56# exit with non-zero status after issuing an appropriate message if
57# it wants to stop the commit.
58
59set -eu
60
61tests/scripts/check-generated-files.sh