Skip to content

Commit

Permalink
forge--set-connections: Restore kludge for Gitlab labels
Browse files Browse the repository at this point in the history
It was dropped a few commits ago in [1: 5d7829e].

Closes #750.

1: 2025-01-26 5d7829e
   forge--set-id-slots: Remove special case
  • Loading branch information
tarsius committed Jan 29, 2025
1 parent 839dc74 commit 0e1579b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
14 changes: 12 additions & 2 deletions lisp/forge-core.el
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,20 @@ Using OBJ itself would not be appropriate because multiple
non-equal objects may exist, representing the same thing."
(oref obj id))

(defun forge--set-connections (repo object slot ids)
(defun forge--set-connections (repo object slot list)
(closql-dset object slot
(let ((rid (oref repo id)))
(mapcar (##forge--object-id rid (alist-get 'id %)) ids))
(mapcar (lambda (value)
(forge--object-id
rid
(if (atom value)
;; For Gitlab labels we unfortunately only
;; get a string, the ambigious name of the
;; label. See also the comment in the
;; Gitlab `forge--update-labels' method.
value
(alist-get 'id value))))
list))
t))

;;; Format
Expand Down
3 changes: 2 additions & 1 deletion lisp/forge-gitlab.el
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,8 @@
;; tagged with the old label name until it itself
;; is modified somehow. Additionally it leads to
;; name conflicts between group and project
;; labels. See #160.
;; labels. See #160. Also see the comment in
;; `forge--set-connections'.
(list (forge--object-id id .name)
.name
(downcase .color)
Expand Down

0 comments on commit 0e1579b

Please sign in to comment.