Function: forge--create-pullreq-from-issue

forge--create-pullreq-from-issue is a byte-compiled function defined in forge-github.el.

Signature

(forge--create-pullreq-from-issue ARG0 ARG &rest ARGS)

Implementations

(forge--create-pullreq-from-issue (REPO forge-github-repository) (ISSUE forge-issue) SOURCE TARGET) in `forge-github.el'.

Undocumented

Source Code

;; Defined in ~/.emacs.d/elpa/forge-20260408.1922/forge-github.el
(cl-defmethod forge--create-pullreq-from-issue
  ((repo  forge-github-repository)
   (issue forge-issue)
   source target)
  (pcase-let* ((`(,base-remote . ,base-branch)
                (magit-split-branch-name target))
               (`(,head-remote . ,head-branch)
                (magit-split-branch-name source))
               (head-repo (forge-get-repository :stub head-remote)))
    (forge-rest repo "POST" "/repos/:owner/:repo/pulls"
      ((issue (oref issue number))
       (base base-branch)
       (head (if (equal head-remote base-remote)
                 head-branch
               (concat (oref head-repo owner) ":" head-branch)))
       (maintainer_can_modify t))
      :callback  (lambda (&rest _)
                   (closql-delete issue)
                   (forge--pull repo))
      :errorback (lambda (&rest _) (forge--pull repo)))))