update packages
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
;;; magit-push.el --- update remote objects and refs -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2008-2020 The Magit Project Contributors
|
||||
;; Copyright (C) 2008-2021 The Magit Project Contributors
|
||||
;;
|
||||
;; You should have received a copy of the AUTHORS.md file which
|
||||
;; lists all contributors. If not, see http://magit.vc/authors.
|
||||
@@ -87,8 +87,12 @@ argument the push-remote can be changed before pushed to it."
|
||||
:if 'magit-get-current-branch
|
||||
:description 'magit-push--pushbranch-description
|
||||
(interactive (list (magit-push-arguments)))
|
||||
(pcase-let ((`(,branch ,remote)
|
||||
(pcase-let ((`(,branch ,remote ,changed)
|
||||
(magit--select-push-remote "push there")))
|
||||
(when changed
|
||||
(magit-confirm 'set-and-push
|
||||
(format "Really use \"%s\" as push-remote and push \"%s\" there"
|
||||
remote branch)))
|
||||
(run-hooks 'magit-credential-hook)
|
||||
(magit-run-git-async "push" "-v" args remote
|
||||
(format "refs/heads/%s:refs/heads/%s"
|
||||
@@ -136,16 +140,19 @@ the upstream."
|
||||
branches nil nil nil 'magit-revision-history
|
||||
(or (car (member (magit-remote-branch-at-point) branches))
|
||||
(car (member "origin/master" branches)))))
|
||||
(upstream (or (magit-get-tracked upstream)
|
||||
(magit-split-branch-name upstream))))
|
||||
(setq remote (car upstream))
|
||||
(setq merge (cdr upstream))
|
||||
(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
|
||||
;; correct thing to do. It is even more likely that it
|
||||
;; is what the user wants to happen.
|
||||
(setq merge (concat "refs/heads/" merge))))
|
||||
(setq merge (concat "refs/heads/" merge)))
|
||||
(magit-confirm 'set-and-push
|
||||
(format "Really use \"%s\" as upstream and push \"%s\" there"
|
||||
upstream branch)))
|
||||
(cl-pushnew "--set-upstream" args :test #'equal))
|
||||
(run-hooks 'magit-credential-hook)
|
||||
(magit-run-git-async "push" "-v" args remote (concat branch ":" merge))))
|
||||
@@ -262,8 +269,8 @@ branch as default."
|
||||
(run-hooks 'magit-credential-hook)
|
||||
(magit-run-git-async "push" remote ref args))
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-push-implicitly (args)
|
||||
;;;###autoload (autoload 'magit-push-implicitly "magit-push" nil t)
|
||||
(transient-define-suffix magit-push-implicitly (args)
|
||||
"Push somewhere without using an explicit refspec.
|
||||
|
||||
This command simply runs \"git push -v [ARGS]\". ARGS are the
|
||||
@@ -273,9 +280,13 @@ these Git variables: `push.default', `remote.pushDefault',
|
||||
`branch.<branch>.pushRemote', `branch.<branch>.remote',
|
||||
`branch.<branch>.merge', and `remote.<remote>.push'.
|
||||
|
||||
The function `magit-push-implicitly--desc' attempts to predict
|
||||
what this command will do. The value it returns is displayed in
|
||||
the popup buffer."
|
||||
If you add this suffix to a transient prefix without explicitly
|
||||
specifying the description, then an attempt is made to predict
|
||||
what this command will do. For example:
|
||||
|
||||
(transient-insert-suffix 'magit-push \"p\"
|
||||
'(\"i\" magit-push-implicitly))"
|
||||
:description 'magit-push-implicitly--desc
|
||||
(interactive (list (magit-push-arguments)))
|
||||
(run-hooks 'magit-credential-hook)
|
||||
(magit-run-git-async "push" "-v" args))
|
||||
|
||||
Reference in New Issue
Block a user