Skip to content

Commit

Permalink
fix and cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius authored and DamienCassou committed Oct 24, 2022
1 parent 3f6639a commit ba9db11
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions lisp/forge-commands.el
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ Takes the pull-request as only argument and must return a directory."
:group 'forge
:type 'function)

(defcustom forge-checkout-reset-existing-branch
nil
"srtsrt"
(defcustom forge-checkout-reset-existing-branch nil
"TODO"
:package-version '(forge . "0.4.0")
:group 'forge
:type '(choice (const :tag "Reset the branch as it exists remotely" t)
Expand Down Expand Up @@ -747,19 +746,17 @@ because the source branch has been deleted"))
(defun forge-checkout-pullreq (pullreq)
"Checkout the branch of a PULLREQ."
(interactive (list (forge-read-pullreq "Checkout pull request" t)))
(when-let* (pullreq
(pullreq (forge-get-pullreq pullreq))
(when-let* ((pullreq (forge-get-pullreq pullreq))
(branch (or (if (not (eq (oref pullreq state) 'open))
(magit-ref-p (format "refs/pullreqs/%s"
(oref pullreq number)))
(forge--pullreq-branch-active pullreq))
(forge--pullreq-branch-internal pullreq))))
(magit-checkout
(if (or
(not (magit-branch-p branch))
(eq forge-checkout-reset-existing-branch t)
(and (eq forge-checkout-reset-existing-branch 'ask)
(y-or-n-p (format "Reset %s?" branch))))
(if (or (not (magit-branch-p branch))
(eq forge-checkout-reset-existing-branch t)
(and (eq forge-checkout-reset-existing-branch 'ask)
(y-or-n-p (format "Reset %s?" branch))))
(let ((magit-inhibit-refresh t))
(forge-branch-pullreq pullreq))
branch))))
Expand Down

0 comments on commit ba9db11

Please sign in to comment.