Function: forge--merge-pullreq

forge--merge-pullreq is a byte-compiled function defined in forge-github.el.

Signature

(forge--merge-pullreq &rest ARGS)

Implementations

(forge--merge-pullreq (REPO forge-gitlab-repository) (TOPIC forge-topic) HASH METHOD) in `forge-gitlab.el'.

Undocumented

(forge--merge-pullreq (REPO forge-github-repository) (TOPIC forge-pullreq) HASH METHOD) in `forge-github.el'.

Undocumented

Source Code

;; Defined in /nix/store/923zwib42c4qw6x4xps0cv1wi8qcd6lp-emacs-packages-deps/share/emacs/site-lisp/elpa/forge-20261005.753/forge-github.el
(cl-defmethod forge--merge-pullreq
  ((repo  forge-github-repository)
   (topic forge-pullreq)
   hash method)
  (forge-mutate topic mergePullRequest
    ((pullRequestId (oref topic their-id))
     (mergeMethod (upcase (symbol-name method)))
     (and hash (expectedHeadOid hash)))
    :callback
    (lambda (_)
      (forge--pull
       repo
       (lambda ()
         (when-let* ((branch (or (forge--pullreq-branch-active topic)
                                 (forge--branch-pullreq topic)))
                     (upstream (magit-get-local-upstream-branch branch))
                     (remote (oref repo remote)))
           (magit-call-git "checkout" upstream)
           (magit-call-git "pull" "--ff-only" remote (magit-pull-arguments))
           (magit-call-git "branch" "-d" branch)
           (forge-refresh-buffer)))))))