Use numeric ids for git repositories

This commit is contained in:
Christopher Baines 2019-09-05 16:40:39 +02:00
parent 38adedcede
commit fe8102e1df
3 changed files with 15 additions and 7 deletions

View file

@ -11,10 +11,17 @@
guix-revisions-and-jobs-for-git-repository))
(define (all-git-repositories conn)
(map
(match-lambda
((id label url cgit-base-url)
(list (string->number id)
label
url
cgit-base-url)))
(exec-query
conn
(string-append
"SELECT id, label, url, cgit_url_base FROM git_repositories ORDER BY id ASC")))
"SELECT id, label, url, cgit_url_base FROM git_repositories ORDER BY id ASC"))))
(define (select-git-repository conn id)
(match (exec-query

View file

@ -829,7 +829,8 @@
(view-git-repository
id
label url cgit-url-base
(all-branches-with-most-recent-commit conn id))))
(all-branches-with-most-recent-commit conn
(string->number id)))))
(#f
(render-html
#:sxml (general-not-found
@ -853,7 +854,7 @@
parsed-query-parameters
(most-recent-commits-for-branch
conn
repository-id
(string->number repository-id)
branch-name
#:limit (assq-ref parsed-query-parameters 'limit_results)
#:after-date (assq-ref parsed-query-parameters

View file

@ -916,7 +916,7 @@
`(tr
(td
(a (@ (href ,(string-append
"/repository/" git-repository-id
"/repository/" (number->string git-repository-id)
"/branch/" name)))
,name))
(td ,date)