summaryrefslogtreecommitdiff
path: root/lib/hooks/dotfiles-pre-push
blob: a3f048dcdc3b0dd960014642460e60f87d4feb66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

remote="$1"
url="$2"

z40=0000000000000000000000000000000000000000

while read local_ref local_sha remote_ref remote_sha; do
    if [ "$local_sha" = $z40 ]; then
        # Permit deletion of branches
        :
    else
        if [ "$remote_ref" = "refs/heads/master" ]; then
            if git verify-commit-by-fp \
                   8DC2487E51ABDD90B5C4753F0F56D0553B6D411B "$local_sha"
            then
                echo "Proposed new master has been signed by Sean"
            else
                echo >&2 "Proposed new master has not been PGP-signed by Sean"
                exit 1
            fi
        fi
    fi
done

exit 0