summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xetc/git/pre-push21
1 files changed, 13 insertions, 8 deletions
diff --git a/etc/git/pre-push b/etc/git/pre-push
index 19c344d91e..51c400e42e 100755
--- a/etc/git/pre-push
+++ b/etc/git/pre-push
@@ -23,6 +23,14 @@
# This is the "empty hash" used by Git when pushing a branch deletion.
z40=0000000000000000000000000000000000000000
+guix_git_authenticate() {
+ set -e
+ guix git authenticate
+ exec make check-channel-news
+ exit 127
+}
+
+main() {
while read local_ref local_hash remote_ref remote_hash
do
# When deleting a remote branch, no commits are pushed to the remote, and
@@ -39,16 +47,10 @@ do
# Only use the hook when pushing to upstream.
case "$2" in
*.gnu.org*)
- set -e
- guix git authenticate
- exec make check-channel-news
- exit 127
+ guix_git_authenticate
;;
*codeberg.org/guix/*)
- set -e
- guix git authenticate
- exec make check-channel-news
- exit 127
+ guix_git_authenticate
;;
*)
exit 0
@@ -58,3 +60,6 @@ do
done
exit 0
+}
+
+main "$@"