From b10142110a9915838368d381d65493c28304a55d Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 21 Oct 2023 16:42:17 +0100 Subject: Handle the case when a series has no patches In patchwork-series->branch. --- guix-qa-frontpage/manage-patch-branches.scm | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/guix-qa-frontpage/manage-patch-branches.scm b/guix-qa-frontpage/manage-patch-branches.scm index 63d1054..886b429 100644 --- a/guix-qa-frontpage/manage-patch-branches.scm +++ b/guix-qa-frontpage/manage-patch-branches.scm @@ -178,14 +178,13 @@ (analyze bug-number feature-branch version index total arguments)))))) (define (patchwork-series->branch series) - (let* ((first-patch - (vector-ref - (assoc-ref series "patches") - 0)) - (details - (parse-patch-name - (assoc-ref first-patch "name")))) - (assq-ref details 'branch))) + (match (assoc-ref series "patches") + (#() "master") + (#(first-patch rest ...) + (let ((details + (parse-patch-name + (assoc-ref first-patch "name")))) + (assq-ref details 'branch))))) (define (create-branch-for-issue database issue-number patchwork-series) (define branch-name -- cgit v1.2.3