diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2020-12-24 11:17:09 +0100 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2020-12-25 01:04:36 +0100 |
| commit | 3c4259e3e090d8575a6bcf80ad53a393bb16b05f (patch) | |
| tree | e57ebb202365fc7d64e004982b6e9b801cd383f2 /lisp/magit-push.el | |
| parent | ab0e0b80abcc01ca041321d1ffd2b9c0d83e2465 (diff) | |
Improve push confirmation before setting and pushing
We only intended to require confirmation when setting the value
before pushing, but in one case the same code path is used when
the value is already set.
Diffstat (limited to 'lisp/magit-push.el')
| -rw-r--r-- | lisp/magit-push.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/magit-push.el b/lisp/magit-push.el index c307f2a..68ca312 100644 --- a/lisp/magit-push.el +++ b/lisp/magit-push.el @@ -87,11 +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"))) - (magit-confirm 'set-and-push - (format "Really use %S as push-remote and push %S there" - remote branch)) + (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" @@ -150,7 +151,7 @@ the upstream." ;; is what the user wants to happen. (setq merge (concat "refs/heads/" merge))) (magit-confirm 'set-and-push - (format "Really use %S as upstream and push %S there" + (format "Really use \"%s\" as upstream and push \"%s\" there" upstream branch))) (cl-pushnew "--set-upstream" args :test #'equal)) (run-hooks 'magit-credential-hook) |
