[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/03: git-authenticate: 'commit-authorized-keys' properly handles orpha
From: |
guix-commits |
Subject: |
03/03: git-authenticate: 'commit-authorized-keys' properly handles orphan commits. |
Date: |
Mon, 8 Jun 2020 18:36:53 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit eef859e8538a74f7dd743bf294f9c32a62a52381
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Jun 8 22:25:59 2020 +0200
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(-)
diff --git a/guix/git-authenticate.scm b/guix/git-authenticate.scm
index 00d22ef..c333717 100644
--- a/guix/git-authenticate.scm
+++ b/guix/git-authenticate.scm
@@ -184,8 +184,11 @@ to remove '.guix-authorizations' file")
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 '()))