Commit 3164aae4 authored by Jonas Bernoulli's avatar Jonas Bernoulli

magit-push: always read target

Previously the upstream branch, if any, was used without requiring
confirmation or letting the user pick another target.
parent 606ef594
......@@ -3694,8 +3694,8 @@ Also see [[info:gitman#git-push]].
- Key: P o, magit-push
Push a branch to its upstream branch. If the upstream isn't set,
then read the remote branch.
Push an arbitrary branch or commit somewhere. Both the source and
the target are read in the minibuffer.
- Key: P m, magit-push-matching
......
......@@ -5233,8 +5233,8 @@ remote branch.
@cindex magit-push
@item @kbd{P o} @tie{}@tie{}@tie{}@tie{}(@code{magit-push})
Push a branch to its upstream branch. If the upstream isn't set,
then read the remote branch.
Push an arbitrary branch or commit somewhere. Both the source and
the target are read in the minibuffer.
@kindex P m
@cindex magit-push-matching
......
......@@ -237,11 +237,17 @@ Read the local and remote branch."
(magit-git-push branch target args))
;;;###autoload
(defun magit-push (branch target args)
"Push a branch to its upstream branch.
If the upstream isn't set, then read the remote branch."
(interactive (magit-push-read-args t))
(magit-git-push branch target args))
(defun magit-push (source target args)
"Push an arbitrary branch or commit somewhere.
Both the source and the target are read in the minibuffer."
(interactive
(let ((source (magit-read-local-branch-or-commit "Push")))
(list source
(magit-read-remote-branch (format "Push %s to" source) nil
(magit-get-tracked-branch source)
source 'confirm)
(magit-push-arguments))))
(magit-git-push source target args))
(defun magit-push-read-args (&optional use-upstream use-current default-current)
(let* ((current (magit-get-current-branch))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment