mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-09-26 21:15:53 +08:00

1. please run hooks/install_hooks.sh manually for the first time 2. hooks/pre-commit.hook is called before commit automatically 3. format code Change-Id: I4565b206da10abb59506ef73f62392c9e9690cd4 Signed-off-by: Lin Kesheng <lks@rock-chips.com>
24 lines
378 B
Bash
Executable File
24 lines
378 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# install git hooks
|
|
|
|
src_dir=../../hooks
|
|
dst_dir=../.git/hooks
|
|
|
|
if test ! \( -x $dst_dir/pre-commit -a -L $dst_dir/pre-commit \);
|
|
|
|
then
|
|
|
|
rm -f $dst_dir/pre-commit
|
|
|
|
if ! ln -s $src_dir/pre-commit.hook $dst_dir/pre-commit 2> /dev/null
|
|
|
|
then
|
|
|
|
echo "Failed to create commit hook symlink, copying instead ..."
|
|
cp pre-commit.hook ../.git/hooks/pre-commit
|
|
|
|
fi
|
|
|
|
fi
|