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)) guix-revisions-and-jobs-for-git-repository))
(define (all-git-repositories conn) (define (all-git-repositories conn)
(exec-query (map
conn (match-lambda
(string-append ((id label url cgit-base-url)
"SELECT id, label, url, cgit_url_base FROM git_repositories ORDER BY id ASC"))) (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"))))
(define (select-git-repository conn id) (define (select-git-repository conn id)
(match (exec-query (match (exec-query

View file

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

View file

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