1 Star 0 Fork 0

黄文彬/wolfssl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
pre-commit.sh 1017 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/bin/sh
#
#
# Our "pre-commit" hook.
# save current config
echo "\n\nSaving current config\n\n"
cp config.status tmp.status
cp wolfssl/options.h tmp.options.h
# stash modified files, if any, that are not part of this commit, don't test
# them
STASHED=0
if ! git diff --quiet
then
STASHED=1
echo "\n\nStashing modified files not part of commit\n\n"
git stash -q --keep-index
fi
# do the commit tests
echo "\n\nRunning commit tests...\n\n"
./commit-tests.sh
RESULT=$?
# restore modified files not part of this commit
if test $STASHED -eq 1
then
echo "\n\nPopping stashed modified files not part of commit\n"
git stash pop -q
fi
# restore current config
echo "\nRestoring current config\n"
mv tmp.status config.status
# don't show output in case error from above
./config.status >/dev/null 2>&1
mv tmp.options.h wolfssl/options.h
make clean >/dev/null 2>&1
make -j 8 >/dev/null 2>&1
[ $RESULT -ne 0 ] && echo "\nOops, your commit failed\n" && exit 1
echo "\nCommit tests passed!\n"
exit 0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wenbinhuang/wolfssl.git
git@gitee.com:wenbinhuang/wolfssl.git
wenbinhuang
wolfssl
wolfssl
master

搜索帮助