branch: master
commit ae4179907f5b2359adadfe12219c711b6f9687ee
Author: Ludovic Courtès <[email protected]>
AuthorDate: Mon Jun 26 23:36:24 2023 +0200
database: 'db-get-latest-checkout' might get zero rows.
* src/cuirass/database.scm (db-get-latest-checkout): Remove call to
'expect-one-row' and adjust 'match' pattern accordingly.
---
src/cuirass/database.scm | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 0be7000..a3e8b19 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -1459,13 +1459,12 @@ WHERE evaluation =" eval-id " ORDER BY channel ASC;"))
"Return the first checkout for the CHANNEL channel, part of SPEC
specification with an evaluation id inferior or equal to EVAL-ID."
(with-db-worker-thread db
- (match (expect-one-row
- (exec-query/bind
- db " SELECT channel, revision, directory FROM Checkouts
+ (match (exec-query/bind
+ db " SELECT channel, revision, directory FROM Checkouts
WHERE specification = " spec " AND channel = " (symbol->string channel)
- " AND evaluation <= " eval-id "ORDER BY evaluation DESC LIMIT 1;"))
+ " AND evaluation <= " eval-id "ORDER BY evaluation DESC LIMIT 1;")
(() #f)
- ((channel revision directory)
+ (((channel revision directory))
`((#:commit . ,revision)
(#:channel . ,(string->symbol channel))
(#:directory . ,directory))))))