diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-06-08 22:25:59 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-06-09 00:34:52 +0200 |
commit | eef859e8538a74f7dd743bf294f9c32a62a52381 (patch) | |
tree | a2f5848e1418ebcd19b4b3875cec8504e43ea1f7 | |
parent | 72357e2170e88f73c11ff089f87a744cee8606ec (diff) | |
download | guix-eef859e8538a74f7dd743bf294f9c32a62a52381.tar.gz |
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.
-rw-r--r-- | guix/git-authenticate.scm | 7 |
1 files changed, 5 insertions, 2 deletions
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 @@ 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 '())) |