mirror of
https://github.com/linux-msm/cdba.git
synced 2026-02-25 13:11:56 -08:00
Introduce some scripts to allow storing users public keys in a git and some hooks such that when this is pushed to the server the authorized_keys file is re-generated. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
19 lines
291 B
Bash
19 lines
291 B
Bash
#!/bin/sh
|
|
|
|
refname="$1"
|
|
oldrev="$2"
|
|
newrev="$3"
|
|
|
|
if [ "$refname" != "refs/heads/main" ]; then
|
|
echo "Only refs/heads/main allowed"
|
|
exit 1
|
|
fi
|
|
|
|
zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
|
|
if [ "$newrev" = "$zero" ]; then
|
|
echo "Don't delete main branch"
|
|
exit 1
|
|
fi
|
|
|
|
exit 0
|