Skip to content

Commit

Permalink
forge-get-url(commit): Use pcase-setq
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed Dec 18, 2024
1 parent b2bf67a commit 3b80ace
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lisp/forge-commands.el
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,7 @@ argument also offer closed pull-requests."
(cl-defmethod forge-get-url ((_(eql :branch)) branch)
(let (remote)
(if (magit-remote-branch-p branch)
(let ((cons (magit-split-branch-name branch)))
(setq remote (car cons))
(setq branch (cdr cons)))
(pcase-setq `(,remote . ,branch) (magit-split-branch-name branch))
(unless (setq remote (or (magit-get-push-remote branch)
(magit-get-upstream-remote branch)))
(user-error "Cannot determine remote for %s" branch)))
Expand Down

0 comments on commit 3b80ace

Please sign in to comment.