Add #:authenticate? parameter to ‘git-repository-url->git-repository-id’.
This commit is contained in:
parent
53710e73b3
commit
ff7697477f
1 changed files with 14 additions and 4 deletions
|
|
@ -225,7 +225,11 @@ FROM git_repositories WHERE id = $1"
|
|||
(((id))
|
||||
(string->number id))))
|
||||
|
||||
(define (git-repository-url->git-repository-id conn url)
|
||||
(define* (git-repository-url->git-repository-id conn url
|
||||
#:key (authenticate? #t))
|
||||
(define (->boolean value)
|
||||
(if value "TRUE" "FALSE"))
|
||||
|
||||
(let ((existing-id
|
||||
(exec-query
|
||||
conn
|
||||
|
|
@ -233,15 +237,21 @@ FROM git_repositories WHERE id = $1"
|
|||
"SELECT id FROM git_repositories WHERE url = '" url "'"))))
|
||||
(string->number
|
||||
(match existing-id
|
||||
(((id)) id)
|
||||
(((id))
|
||||
(exec-query conn
|
||||
(string-append "UPDATE git_repositories \
|
||||
SET fetch_with_authentication = "
|
||||
(->boolean authenticate?)
|
||||
" WHERE id = " id ";"))
|
||||
id)
|
||||
(()
|
||||
(caar
|
||||
(exec-query conn
|
||||
(string-append
|
||||
"INSERT INTO git_repositories "
|
||||
"(url) "
|
||||
"(url, fetch_with_authentication) "
|
||||
"VALUES "
|
||||
"('" url "') "
|
||||
"('" url "', " (->boolean authenticate?) ") "
|
||||
"RETURNING id"))))))))
|
||||
|
||||
(define (guix-revisions-and-jobs-for-git-repository conn git-repository-id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue