Skip to content

Commit

Permalink
Revert "Use pcase-setq"
Browse files Browse the repository at this point in the history
This reverts commit ac3ff10.

This macro was added in Emacs 28.1, and for some reason Compat
does not provide a backport.
  • Loading branch information
tarsius committed Sep 19, 2023
1 parent 18d1b13 commit ae6cae2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
12 changes: 8 additions & 4 deletions lisp/magit-extras.el
Original file line number Diff line number Diff line change
Expand Up @@ -714,17 +714,21 @@ the minibuffer too."
"1"))))
pnt-args eob-args)
(when (listp pnt-format)
(pcase-setq `(,pnt-format . ,pnt-args) pnt-format))
(setq pnt-args (cdr pnt-format))
(setq pnt-format (car pnt-format)))
(when (listp eob-format)
(pcase-setq `(,eob-format . ,eob-args) eob-format))
(setq eob-args (cdr eob-format))
(setq eob-format (car eob-format)))
(when pnt-format
(when idx-format
(setq pnt-format (string-replace "%N" idx pnt-format)))
(setq pnt-format
(string-replace "%N" idx pnt-format)))
(magit-rev-insert-format pnt-format rev pnt-args)
(delete-char -1))
(when eob-format
(when idx-format
(setq eob-format (string-replace "%N" idx eob-format)))
(setq eob-format
(string-replace "%N" idx eob-format)))
(save-excursion
(goto-char (point-max))
(skip-syntax-backward ">-")
Expand Down
9 changes: 5 additions & 4 deletions lisp/magit-push.el
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@ the upstream."
(format "Set upstream of %s and push there" branch)
branches nil nil nil 'magit-revision-history
(or (car (member (magit-remote-branch-at-point) branches))
(car (member "origin/master" branches))))))
(pcase-setq `(,remote . ,merge)
(or (magit-get-tracked upstream)
(magit-split-branch-name upstream)))
(car (member "origin/master" branches)))))
(upstream* (or (magit-get-tracked upstream)
(magit-split-branch-name upstream))))
(setq remote (car upstream*))
(setq merge (cdr upstream*))
(unless (string-prefix-p "refs/" merge)
;; User selected a non-existent remote-tracking branch.
;; It is very likely, but not certain, that this is the
Expand Down

0 comments on commit ae6cae2

Please sign in to comment.