mirror of
https://github.com/systemd/systemd.git
synced 2024-12-04 07:43:38 +08:00
003c887967
This was done autogen.sh previously and was dropped in
72cdb3e783
. Let's add it back.
The meson configuration step is the only reasonable place.
Note that this only works for the most standard git dirs, e.g.
the hook will not be installed if git worktree is used or if
$GIT_DIR is specified, etc. I think that's OK because most of
the time meson will be run at least once in the original cloned
dir.
12 lines
268 B
Bash
Executable File
12 lines
268 B
Bash
Executable File
#!/bin/sh -eu
|
|
|
|
cd "$MESON_SOURCE_ROOT"
|
|
|
|
if [ ! -f .git/hooks/pre-commit.sample -o -f .git/hooks/pre-commit ]; then
|
|
exit 2 # not needed
|
|
fi
|
|
|
|
cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit
|
|
chmod +x .git/hooks/pre-commit
|
|
echo 'Activated pre-commit hook'
|