Handle NULL values for included_branches

This commit is contained in:
Christopher Baines 2025-01-17 12:23:46 +00:00
parent c886685e92
commit 25bf45fe77
3 changed files with 10 additions and 16 deletions

View file

@ -59,12 +59,10 @@
conn
git-repository-id)))
(let ((excluded-branch?
(branch-in-list? excluded-branches branch-name))
(included-branch?
(branch-in-list? included-branches branch-name)))
(branch-in-list? excluded-branches branch-name)))
(when (and (not excluded-branch?)
(or (null? included-branches)
included-branch?))
(or (NULL? included-branches)
(branch-in-list? included-branches branch-name)))
(if (string=? commit-all-zeros x-git-newrev)
(insert-git-commit-entry conn
(or (git-branch-for-repository-and-name

View file

@ -139,7 +139,7 @@ WHERE id = $1"
item))
lst))
(match (exec-query
(match (exec-query-with-null-handling
conn
"
SELECT included_branches, excluded_branches
@ -147,13 +147,11 @@ FROM git_repositories WHERE id = $1"
(list (number->string id)))
(((included_branches excluded_branches))
(values
(if (or (eq? #f included_branches)
(string-null? included_branches))
'()
(if (NULL? included_branches)
included_branches
(make-regexes
(parse-postgresql-array-string included_branches)))
(if (or (eq? excluded_branches #f)
(string-null? excluded_branches))
(if (NULL? excluded_branches)
'()
(make-regexes
(parse-postgresql-array-string excluded_branches)))))))

View file

@ -182,12 +182,10 @@
(filter
(lambda (branch-name)
(let ((excluded-branch?
(branch-in-list? excluded-branches branch-name))
(included-branch?
(branch-in-list? included-branches branch-name)))
(branch-in-list? excluded-branches branch-name)))
(and (not excluded-branch?)
(or (null? included-branches)
included-branch?))))
(or (NULL? included-branches)
(branch-in-list? included-branches branch-name)))))
(delete-duplicates!
(append!
(map car repository-branches)