1:255.16-alt1
[systemd_ALT.git] / tools / add-git-hook.sh
blob8cff62e864da9c9a1733b775d1743fe2aa7ca95c
1 #!/bin/sh
2 # SPDX-License-Identifier: LGPL-2.1-or-later
3 set -eu
5 cd "${MESON_SOURCE_ROOT:?}"
7 if [ ! -f .git/hooks/pre-commit.sample ] || [ -f .git/hooks/pre-commit ]; then
8 exit 2 # not needed
9 fi
11 cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit
12 chmod +x .git/hooks/pre-commit
13 echo 'Activated pre-commit hook'