Starting to use Uniglot for hooks standardization.

这个提交包含在:
2022-04-30 23:14:56 -05:00
父节点 ce2e2d3863
当前提交 f034d627a6
共有 17 个文件被更改,包括 234 次插入11 次删除

17
Hooks/pre-receive 可执行文件
查看文件

@@ -0,0 +1,17 @@
#!/bin/bash
# Check each commit
while read oldrev newrev refname; do
# Thanks to https://blog.developer.atlassian.com/stop-foxtrots-now/ for the inspiration
if [ "$refname" == "refs/heads/main" ]; then
match=`git log --first-parent --pretty='%H %P' $oldrev..$newrev |
grep $oldrev |
awk '{ print $2 }'`
if [ "$oldrev" != "$match" ]; then
echo "Foxtrot detected. Please `git rebase origin/main`."
exit 1
fi
fi
done