From ba9db11739a0ad9fafb06325a591a9831d8e087e Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Thu, 15 Sep 2022 17:56:43 +0200 Subject: [PATCH] fix and cosmetics --- lisp/forge-commands.el | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lisp/forge-commands.el b/lisp/forge-commands.el index 35ed58db..26ab9920 100644 --- a/lisp/forge-commands.el +++ b/lisp/forge-commands.el @@ -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) @@ -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))))