diff options
author | Marius Bakke <marius@gnu.org> | 2020-12-21 23:42:10 +0100 |
---|---|---|
committer | Marius Bakke <marius@gnu.org> | 2020-12-21 23:42:10 +0100 |
commit | bbe4ed65ed5fe7dc8ed9d226042852387cee3b1e (patch) | |
tree | 9fbf0642fe71d0d4f6d7cb4e85b4d1587c8b9b16 /etc/git/pre-push | |
parent | 034cfbd2449387c15823cd9ec3e91661f9e5bf49 (diff) | |
parent | f00e68ace070fd5240a4b5874e61c26f6e909b6c (diff) | |
download | guix-bbe4ed65ed5fe7dc8ed9d226042852387cee3b1e.tar.gz |
Merge branch 'master' into ungrafting
Diffstat (limited to 'etc/git/pre-push')
-rwxr-xr-x | etc/git/pre-push | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/etc/git/pre-push b/etc/git/pre-push index 415345fc75..59671b0d58 100755 --- a/etc/git/pre-push +++ b/etc/git/pre-push @@ -20,13 +20,26 @@ # # <local ref> <local sha1> <remote ref> <remote sha1> -# Only use the hook when pushing to Savannah. -case "$2" in - *.gnu.org*) - exec make authenticate check-channel-news - exit 127 - ;; - *) - exit 0 - ;; -esac +# This is the "empty hash" used by Git when pushing a branch deletion. +z40=0000000000000000000000000000000000000000 + +while read local_ref local_hash remote_ref remote_hash +do + # When deleting a remote branch, no commits are pushed to the remote, and + # thus there are no signatures to be verified. + if [ "$local_hash" != $z40 ] + then + # Only use the hook when pushing to Savannah. + case "$2" in + *.gnu.org*) + exec make authenticate check-channel-news + exit 127 + ;; + *) + exit 0 + ;; + esac + fi +done + +exit 0 |