Skip to content

Commit

Permalink
forge--format-topic-milestone: Ignore unknown milestones
Browse files Browse the repository at this point in the history
If a topic was fetched individually, without fetching all data for its
repository, then we might know nothing about its milestone, except for
the id.  Ignore it in that case.
  • Loading branch information
tarsius committed Jun 21, 2024
1 parent 4313ac9 commit f8a7e8a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lisp/forge-topic.el
Original file line number Diff line number Diff line change
Expand Up @@ -809,10 +809,12 @@ can be selected from the start."
(`(forge-pullreq rejected) 'forge-pullreq-rejected)))))))

(defun forge--format-topic-milestone (topic)
(and-let* ((id (oref topic milestone)))
(magit--propertize-face
(caar (forge-sql [:select [title] :from milestone :where (= id $s1)] id))
'forge-topic-label)))
(and-let* ((id (oref topic milestone))
(str (caar (forge-sql [:select [title]
:from milestone
:where (= id $s1)]
id))))
(magit--propertize-face str 'forge-topic-label)))

(defun forge--format-topic-labels (topic)
(and-let* ((labels (closql--iref topic 'labels)))
Expand Down

0 comments on commit f8a7e8a

Please sign in to comment.