Skip to content

Commit

Permalink
forge--pull(gitlab): Add optional CALLBACK argument
Browse files Browse the repository at this point in the history
This argument was added to the github method in [1: 896a934]
and since [2: 02cd283] all methods must make it available.

Closes #622.

1: 2019-11-05 896a934
   forge--pull(github): Add optional CALLBACK argument

2: 2024-01-26 02cd283
   forge--set-field-callback: Also refresh tablist and transient menu
  • Loading branch information
tarsius committed Feb 2, 2024
1 parent c502041 commit b3215a4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lisp/forge-gitlab.el
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
;;; Pull
;;;; Repository

(cl-defmethod forge--pull ((repo forge-gitlab-repository) until)
(cl-defmethod forge--pull ((repo forge-gitlab-repository) until
&optional callback)
(let ((cb (let ((buf (and (derived-mode-p 'magit-mode)
(current-buffer)))
(dir default-directory)
Expand Down Expand Up @@ -81,8 +82,10 @@
(dolist (v .pullreqs) (forge--update-pullreq repo v))
(oset repo sparse-p nil))
(forge--msg repo t t "Storing REPO")
(unless (oref repo selective-p)
(forge--git-fetch buf dir repo)))))))))
(cond
((oref repo selective-p))
(callback (funcall callback))
((forge--git-fetch buf dir repo))))))))))
(funcall cb cb)))

(cl-defmethod forge--fetch-repository ((repo forge-gitlab-repository) callback)
Expand Down

0 comments on commit b3215a4

Please sign in to comment.