From eef859e8538a74f7dd743bf294f9c32a62a52381 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 8 Jun 2020 22:25:59 +0200 Subject: git-authenticate: 'commit-authorized-keys' properly handles orphan commits. Previously it would trigger a wrong-number-of-arguments error for 'lset-intersection'. * guix/git-authenticate.scm (commit-authorized-keys): Add case for when 'commit-parents' returns the empty list. --- guix/git-authenticate.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/git-authenticate.scm b/guix/git-authenticate.scm index 00d22ef479..c333717136 100644 --- a/guix/git-authenticate.scm +++ b/guix/git-authenticate.scm @@ -184,8 +184,11 @@ (define (commit-authorizations commit) default-authorizations) (throw key error))))) - (apply lset-intersection bytevector=? - (map commit-authorizations (commit-parents commit)))) + (match (commit-parents commit) + (() default-authorizations) + (parents + (apply lset-intersection bytevector=? + (map commit-authorizations parents))))) (define* (authenticate-commit repository commit keyring #:key (default-authorizations '())) -- cgit v1.2.3